mirror of
https://github.com/starr-dusT/dotfiles.git
synced 2025-02-19 19:27:31 -08:00
Merge branch 'master' of github.com:starr-dusT/dotfiles
This commit is contained in:
commit
1d94958974
@ -15,17 +15,28 @@
|
|||||||
url = "https://github.com/wbthomason/packer.nvim.git"
|
url = "https://github.com/wbthomason/packer.nvim.git"
|
||||||
refreshPeriod = "168h"
|
refreshPeriod = "168h"
|
||||||
|
|
||||||
[".config/xmonad/xmonad"]
|
[".task"]
|
||||||
type = "git-repo"
|
type = "git-repo"
|
||||||
url = "https://github.com/xmonad/xmonad"
|
url = "git@github.com:starr-dusT/task.git"
|
||||||
refreshPeriod = "168h"
|
refreshPeriod = "168h"
|
||||||
|
|
||||||
[".config/xmonad/xmonad-contrib"]
|
["documents/zet"]
|
||||||
type = "git-repo"
|
type = "git-repo"
|
||||||
url = "https://github.com/xmonad/xmonad-contrib"
|
url = "git@github.com:starr-dusT/zet.git"
|
||||||
refreshPeriod = "168h"
|
refreshPeriod = "168h"
|
||||||
|
|
||||||
[".config/xmonad/xmobar"]
|
### OLD ###
|
||||||
type = "git-repo"
|
#[".config/xmonad/xmonad"]
|
||||||
url = "https://codeberg.org/xmobar/xmobar"
|
# type = "git-repo"
|
||||||
refreshPeriod = "168h"
|
# url = "https://github.com/xmonad/xmonad"
|
||||||
|
# refreshPeriod = "168h"
|
||||||
|
#
|
||||||
|
#[".config/xmonad/xmonad-contrib"]
|
||||||
|
# type = "git-repo"
|
||||||
|
# url = "https://github.com/xmonad/xmonad-contrib"
|
||||||
|
# refreshPeriod = "168h"
|
||||||
|
#
|
||||||
|
#[".config/xmonad/xmobar"]
|
||||||
|
# type = "git-repo"
|
||||||
|
# url = "https://codeberg.org/xmobar/xmobar"
|
||||||
|
# refreshPeriod = "168h"
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
sudo mount -t cifs -o rw,uid=$(id -u $(whoami)),gid=$(id -g $(whoami)),vers=3.0,credentials=/home/tstarr/.smb //192.168.1.136/private /home/tstarr/mnt/engi
|
sudo mount -t cifs -o rw,uid=$(id -u $(whoami)),gid=$(id -g $(whoami)),vers=3.0,credentials=/home/tstarr/.smb //192.168.1.175/private /home/tstarr/mnt/engi
|
||||||
|
9
home/bin/executable_linux-toggle-vpn
Normal file
9
home/bin/executable_linux-toggle-vpn
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if [ -f ~/.wg0 ]; then
|
||||||
|
sudo systemctl stop wg-quick-wg0.service
|
||||||
|
rm ~/.wg0
|
||||||
|
else
|
||||||
|
sudo systemctl restart wg-quick-wg0.service
|
||||||
|
touch ~/.wg0
|
||||||
|
fi
|
@ -91,7 +91,8 @@ gaps left 0
|
|||||||
|
|
||||||
for_window [title="Steam - News"] floating enable
|
for_window [title="Steam - News"] floating enable
|
||||||
for_window [title="Friends List"] floating enable
|
for_window [title="Friends List"] floating enable
|
||||||
for_window [title="Picture-in-Picture"] sticky toggle
|
for_window [title=".*mpv$"] sticky toggle
|
||||||
|
for_window [title=".*mpv$"] floating enable
|
||||||
|
|
||||||
for_window [app_id="file"] floating enable, \
|
for_window [app_id="file"] floating enable, \
|
||||||
border pixel 5, \
|
border pixel 5, \
|
||||||
@ -126,7 +127,6 @@ mode utility {
|
|||||||
bindsym q exit
|
bindsym q exit
|
||||||
bindsym r reload
|
bindsym r reload
|
||||||
bindsym g exec "~/.config/sway/scripts/gamemode.sh", $e
|
bindsym g exec "~/.config/sway/scripts/gamemode.sh", $e
|
||||||
bindsym v exec "~/.config/sway/scripts/toggle-vpn.sh {{ .hostname }}", $e
|
|
||||||
bindsym Escape mode default
|
bindsym Escape mode default
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -197,6 +197,7 @@ mode open {
|
|||||||
bindsym b exec chromium, $e
|
bindsym b exec chromium, $e
|
||||||
bindsym s exec steam || flatpak run com.valvesoftware.Steam, $e
|
bindsym s exec steam || flatpak run com.valvesoftware.Steam, $e
|
||||||
bindsym d exec discord || flatpak run com.discordapp.Discord, $e
|
bindsym d exec discord || flatpak run com.discordapp.Discord, $e
|
||||||
|
bindsym m exec mpv $(wl-paste), $e
|
||||||
bindsym Escape mode default
|
bindsym Escape mode default
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,11 +44,11 @@ txmb=$(echo "scale = 1; $tx / 1280000" | bc | awk '{printf "%05.1f\n", $0}')
|
|||||||
rxmb=$(echo "scale = 1; $rx / 1280000" | bc | awk '{printf "%05.1f\n", $0}')
|
rxmb=$(echo "scale = 1; $rx / 1280000" | bc | awk '{printf "%05.1f\n", $0}')
|
||||||
|
|
||||||
# Vpn status
|
# Vpn status
|
||||||
vpn=$(nmcli c show --active | grep wireguard | cut -d ' ' -f1)
|
if [ -f ~/.wg0 ] ; then
|
||||||
if $vpn ; then
|
vpn="wg0"
|
||||||
|
else
|
||||||
vpn="none"
|
vpn="none"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#<span foreground='#c16b26'>lel</span>
|
#<span foreground='#c16b26'>lel</span>
|
||||||
echo -e "👍 $txmb 👎 $rxmb | 📡 $vpn | ⬆️ $uptime_formatted | 🔉<span foreground='$volume_color'>$volume%</span> | $gamemode | 🐧 $linux_version | $date_formatted "
|
echo -e "👍 $txmb 👎 $rxmb | 📡 $vpn | ⬆️ $uptime_formatted | 🔉<span foreground='$volume_color'>$volume%</span> | $gamemode | 🐧 $linux_version | $date_formatted "
|
||||||
|
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
cons=$(nmcli -t -f NAME c show --active | grep $1)
|
|
||||||
if [ $cons ]; then
|
|
||||||
nmcli c down $1 1> /dev/null
|
|
||||||
else
|
|
||||||
nmcli c up $1 1> /dev/null
|
|
||||||
fi
|
|
1
home/private_dot_wireguard/kestrel.pub
Normal file
1
home/private_dot_wireguard/kestrel.pub
Normal file
@ -0,0 +1 @@
|
|||||||
|
hPso657fppLYvBU31Rtqqg792JEoPv7r82JgLoF8S2Y=
|
1
home/private_dot_wireguard/kestrel.tmpl
Normal file
1
home/private_dot_wireguard/kestrel.tmpl
Normal file
@ -0,0 +1 @@
|
|||||||
|
{{ (secret "Wireguard - Kestrel Secret" "NOTES") }}
|
@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
torus = lib.nixosSystem {
|
torus = lib.nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
specialArgs = { inherit user; };
|
specialArgs = { inherit user; inherit pkgs-unstable; };
|
||||||
modules = [
|
modules = [
|
||||||
./hosts/torus/configuration.nix
|
./hosts/torus/configuration.nix
|
||||||
./hosts/torus/hardware.nix
|
./hosts/torus/hardware.nix
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
{ config, pkgs, user, lib, ... }:
|
{ config, pkgs, user, lib, ... }:
|
||||||
{
|
{
|
||||||
|
imports = [
|
||||||
|
../../modules
|
||||||
|
];
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
package = pkgs.nixFlakes;
|
package = pkgs.nixFlakes;
|
||||||
extraOptions = "experimental-features = nix-command flakes";
|
extraOptions = "experimental-features = nix-command flakes";
|
||||||
@ -32,7 +36,6 @@
|
|||||||
|
|
||||||
# Set networking options
|
# Set networking options
|
||||||
networking.hostName = "kestrel";
|
networking.hostName = "kestrel";
|
||||||
networking.networkmanager.enable = true;
|
|
||||||
networking.firewall.checkReversePath = "loose";
|
networking.firewall.checkReversePath = "loose";
|
||||||
networking.firewall.enable = false;
|
networking.firewall.enable = false;
|
||||||
|
|
||||||
@ -52,7 +55,7 @@
|
|||||||
# Define user account.
|
# Define user account.
|
||||||
users.users.${user} = {
|
users.users.${user} = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
extraGroups = [ "wheel" "docker" "libvirtd" ]; # Enable ‘sudo’ for the user.
|
extraGroups = [ "dialout" "wheel" "docker" "libvirtd" ]; # Enable ‘sudo’ for the user.
|
||||||
};
|
};
|
||||||
|
|
||||||
# List packages installed in system profile.
|
# List packages installed in system profile.
|
||||||
@ -63,7 +66,6 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
# Enable modules
|
# Enable modules
|
||||||
imports = [ ../../modules ];
|
|
||||||
modules = {
|
modules = {
|
||||||
desktop = {
|
desktop = {
|
||||||
sway.enable = true;
|
sway.enable = true;
|
||||||
@ -78,16 +80,22 @@
|
|||||||
steam.enable = true;
|
steam.enable = true;
|
||||||
};
|
};
|
||||||
services = {
|
services = {
|
||||||
#jellyfin.enable = true;
|
jellyfin.enable = false;
|
||||||
peripherals.enable = true;
|
peripherals.enable = true;
|
||||||
samba-client.enable = true;
|
samba-client.enable = true;
|
||||||
#samba-server.enable = true;
|
|
||||||
syncthing.enable = true;
|
syncthing.enable = true;
|
||||||
virt-manager.enable = true;
|
virt-manager.enable = true;
|
||||||
};
|
};
|
||||||
system = {
|
system = {
|
||||||
ssh.enable = true;
|
ssh.enable = true;
|
||||||
terminal.enable = true;
|
terminal.enable = true;
|
||||||
|
wireguard-client = {
|
||||||
|
enable = true;
|
||||||
|
privateKeyFile = "/home/${user}/.wireguard/kestrel";
|
||||||
|
address = [ "192.168.2.3/24" ];
|
||||||
|
publicKey = "bd7bbZOngl/FTdBlnbIhgCLNf6yx5X8WjiRB7E1NEQQ=";
|
||||||
|
endpoint = "66.218.43.87";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
# Did you read the comment?
|
# Did you read the comment?
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
{ config, pkgs, user, lib, ... }:
|
{ config, pkgs, user, lib, ... }:
|
||||||
{
|
{
|
||||||
|
imports = [
|
||||||
|
./wireguard-server.nix
|
||||||
|
./samba-server.nix
|
||||||
|
../../modules
|
||||||
|
];
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
package = pkgs.nixFlakes;
|
package = pkgs.nixFlakes;
|
||||||
extraOptions = "experimental-features = nix-command flakes";
|
extraOptions = "experimental-features = nix-command flakes";
|
||||||
@ -28,8 +34,14 @@
|
|||||||
|
|
||||||
# Set networking options
|
# Set networking options
|
||||||
networking.hostName = "torus";
|
networking.hostName = "torus";
|
||||||
networking.networkmanager.enable = true;
|
# Needed for wireguard-server
|
||||||
|
boot.kernel.sysctl = {
|
||||||
|
"net.ipv4.conf.all.forwarding" = true;
|
||||||
|
};
|
||||||
|
networking.firewall.enable = true;
|
||||||
networking.firewall.checkReversePath = "loose";
|
networking.firewall.checkReversePath = "loose";
|
||||||
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||||
|
networking.firewall.allowedUDPPorts = [ 80 443 ];
|
||||||
|
|
||||||
# Set your time zone.
|
# Set your time zone.
|
||||||
time.timeZone = "America/Los_Angeles";
|
time.timeZone = "America/Los_Angeles";
|
||||||
@ -78,8 +90,6 @@
|
|||||||
defaults.email = "starrtyler88@gmail.com";
|
defaults.email = "starrtyler88@gmail.com";
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
|
||||||
networking.firewall.allowedUDPPorts = [ 80 443 ];
|
|
||||||
|
|
||||||
security.pam.services.nginx.setEnvironment = false;
|
security.pam.services.nginx.setEnvironment = false;
|
||||||
systemd.services.nginx.serviceConfig = {
|
systemd.services.nginx.serviceConfig = {
|
||||||
@ -103,9 +113,6 @@
|
|||||||
"media.tstarr.us" = (SSL // {
|
"media.tstarr.us" = (SSL // {
|
||||||
locations."/".proxyPass = "http://localhost:8096/";
|
locations."/".proxyPass = "http://localhost:8096/";
|
||||||
});
|
});
|
||||||
"joplin.tstarr.us" = (SSL // {
|
|
||||||
locations."/".proxyPass = "http://localhost:22300/";
|
|
||||||
});
|
|
||||||
"wiki.tstarr.us" = (SSL // {
|
"wiki.tstarr.us" = (SSL // {
|
||||||
locations."/".proxyPass = "http://localhost:4567/";
|
locations."/".proxyPass = "http://localhost:4567/";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
@ -117,13 +124,11 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
# Enable modules
|
# Enable modules
|
||||||
imports = [ ../../modules ];
|
|
||||||
modules = {
|
modules = {
|
||||||
devel = {
|
devel = {
|
||||||
tooling.enable = true;
|
tooling.enable = true;
|
||||||
};
|
};
|
||||||
services = {
|
services = {
|
||||||
samba-server.enable = true;
|
|
||||||
jellyfin.enable = true;
|
jellyfin.enable = true;
|
||||||
syncthing.enable = true;
|
syncthing.enable = true;
|
||||||
};
|
};
|
||||||
|
41
provision/nixos/hosts/torus/samba-server.nix
Normal file
41
provision/nixos/hosts/torus/samba-server.nix
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
{
|
||||||
|
services.samba = {
|
||||||
|
enable = true;
|
||||||
|
extraConfig = ''
|
||||||
|
workgroup = WORKGROUP
|
||||||
|
server string = smbnix
|
||||||
|
netbios name = smbnix
|
||||||
|
security = user
|
||||||
|
hosts allow = 192.168.2. 192.168.1. 127.0.0.1 localhost
|
||||||
|
hosts deny = 0.0.0.0/0
|
||||||
|
guest account = nobody
|
||||||
|
map to guest = bad user
|
||||||
|
'';
|
||||||
|
|
||||||
|
shares = {
|
||||||
|
private = {
|
||||||
|
"path" = "/engi";
|
||||||
|
browseable = "yes";
|
||||||
|
"read only" = "no";
|
||||||
|
"guest ok" = "no";
|
||||||
|
"force user" = "tstarr";
|
||||||
|
"force group" = "users";
|
||||||
|
};
|
||||||
|
public = {
|
||||||
|
"path" = "/engi";
|
||||||
|
browseable = "yes";
|
||||||
|
"read only" = "yes";
|
||||||
|
"guest ok" = "yes";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Curiously, `services.samba` does not automatically open
|
||||||
|
# the needed ports in the firewall.
|
||||||
|
networking.firewall.allowedTCPPorts = [ 445 139 ];
|
||||||
|
networking.firewall.allowedUDPPorts = [ 137 138 ];
|
||||||
|
|
||||||
|
# To make SMB mounting easier on the command line
|
||||||
|
environment.systemPackages = with pkgs; [ cifs-utils ];
|
||||||
|
}
|
57
provision/nixos/hosts/torus/wireguard-server.nix
Normal file
57
provision/nixos/hosts/torus/wireguard-server.nix
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
{
|
||||||
|
# Enable NAT
|
||||||
|
networking.nat = {
|
||||||
|
enable = true;
|
||||||
|
enableIPv6 = true;
|
||||||
|
externalInterface = "enp4s0";
|
||||||
|
internalInterfaces = [ "wg0" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Open ports in the firewall
|
||||||
|
networking.firewall = {
|
||||||
|
allowedTCPPorts = [ 53 ];
|
||||||
|
allowedUDPPorts = [ 53 51820 ];
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.wg-quick.interfaces = {
|
||||||
|
# "wg0" is the network interface name. You can name the interface arbitrarily.
|
||||||
|
wg0 = {
|
||||||
|
# Determines the IP/IPv6 address and subnet of the client's end of the tunnel interface
|
||||||
|
address = [ "192.168.2.1/24" ];
|
||||||
|
# The port that WireGuard listens to - recommended that this be changed from default
|
||||||
|
listenPort = 51820;
|
||||||
|
# Path to the server's private key
|
||||||
|
privateKeyFile = "/engi/apps/wireguard/private";
|
||||||
|
|
||||||
|
# This allows the wireguard server to route your traffic to the internet and hence be like a VPN
|
||||||
|
postUp = ''
|
||||||
|
${pkgs.iptables}/bin/iptables -A FORWARD -i %i -j ACCEPT
|
||||||
|
${pkgs.iptables}/bin/iptables -A FORWARD -o %i -j ACCEPT
|
||||||
|
${pkgs.iptables}/bin/iptables -t nat -A POSTROUTING -o enp4s0 -j MASQUERADE
|
||||||
|
|
||||||
|
'';
|
||||||
|
|
||||||
|
# Undo the above
|
||||||
|
preDown = ''
|
||||||
|
${pkgs.iptables}/bin/iptables -D FORWARD -i %i -j ACCEPT
|
||||||
|
${pkgs.iptables}/bin/iptables -D FORWARD -o %i -j ACCEPT
|
||||||
|
${pkgs.iptables}/bin/iptables -t nat -D POSTROUTING -o enp4s0 -j MASQUERADE
|
||||||
|
'';
|
||||||
|
|
||||||
|
peers = [
|
||||||
|
{
|
||||||
|
# Adjudicator
|
||||||
|
publicKey = "r2/IeYCO1T+l248387wUBoNnc2DK9O8pHcIr/NQqezM=";
|
||||||
|
allowedIPs = [ "192.168.2.2/32" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
# Kestrel
|
||||||
|
publicKey = "hPso657fppLYvBU31Rtqqg792JEoPv7r82JgLoF8S2Y=";
|
||||||
|
allowedIPs = [ "192.168.2.3/32" ];
|
||||||
|
}
|
||||||
|
# More peers can be added here.
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
{ ... }:
|
{ ... }:
|
||||||
{
|
{
|
||||||
imports = [ ./syncthing.nix ./samba-server.nix ./samba-client.nix ./jellyfin.nix ./virt-manager.nix ./peripherals.nix ];
|
imports = [ ./syncthing.nix ./samba-client.nix ./jellyfin.nix ./virt-manager.nix ./peripherals.nix ];
|
||||||
}
|
}
|
||||||
|
@ -8,5 +8,4 @@ in {
|
|||||||
services.jellyfin.openFirewall = true;
|
services.jellyfin.openFirewall = true;
|
||||||
services.jellyfin.user = "${user}";
|
services.jellyfin.user = "${user}";
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,10 +4,17 @@ let cfg = config.modules.services.peripherals;
|
|||||||
in {
|
in {
|
||||||
options.modules.services.peripherals.enable = lib.mkEnableOption "peripherals";
|
options.modules.services.peripherals.enable = lib.mkEnableOption "peripherals";
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
# Enable sound.
|
|
||||||
sound.enable = true;
|
# rtkit is optional but recommended
|
||||||
hardware.pulseaudio.enable = true;
|
security.rtkit.enable = true;
|
||||||
hardware.pulseaudio.support32Bit = true;
|
services.pipewire = {
|
||||||
|
enable = true;
|
||||||
|
alsa.enable = true;
|
||||||
|
alsa.support32Bit = true;
|
||||||
|
pulse.enable = true;
|
||||||
|
# If you want to use JACK applications, uncomment this
|
||||||
|
#jack.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
gvfs.enable = true;
|
gvfs.enable = true;
|
||||||
|
@ -1,46 +0,0 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
let cfg = config.modules.services.samba-server;
|
|
||||||
in {
|
|
||||||
options.modules.services.samba-server.enable = lib.mkEnableOption "samba-server";
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
services.samba = {
|
|
||||||
enable = true;
|
|
||||||
extraConfig = ''
|
|
||||||
workgroup = WORKGROUP
|
|
||||||
server string = smbnix
|
|
||||||
netbios name = smbnix
|
|
||||||
security = user
|
|
||||||
hosts allow = 192.168.1. 127.0.0.1 localhost
|
|
||||||
hosts deny = 0.0.0.0/0
|
|
||||||
guest account = nobody
|
|
||||||
map to guest = bad user
|
|
||||||
'';
|
|
||||||
|
|
||||||
shares = {
|
|
||||||
private = {
|
|
||||||
"path" = "/engi";
|
|
||||||
browseable = "yes";
|
|
||||||
"read only" = "no";
|
|
||||||
"guest ok" = "no";
|
|
||||||
"force user" = "tstarr";
|
|
||||||
"force group" = "users";
|
|
||||||
};
|
|
||||||
public = {
|
|
||||||
"path" = "/engi";
|
|
||||||
browseable = "yes";
|
|
||||||
"read only" = "yes";
|
|
||||||
"guest ok" = "yes";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Curiously, `services.samba` does not automatically open
|
|
||||||
# the needed ports in the firewall.
|
|
||||||
networking.firewall.allowedTCPPorts = [ 445 139 ];
|
|
||||||
networking.firewall.allowedUDPPorts = [ 137 138 ];
|
|
||||||
|
|
||||||
# To make SMB mounting easier on the command line
|
|
||||||
environment.systemPackages = with pkgs; [ cifs-utils ];
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,4 +1,4 @@
|
|||||||
{ ... }:
|
{ ... }:
|
||||||
{
|
{
|
||||||
imports = [ ./terminal.nix ./ssh.nix ];
|
imports = [ ./wireguard-client.nix ./terminal.nix ./ssh.nix ];
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, user, ... }:
|
{ config, lib, pkgs, pkgs-unstable, user, ... }:
|
||||||
|
|
||||||
let cfg = config.modules.system.terminal;
|
let cfg = config.modules.system.terminal;
|
||||||
in {
|
in {
|
||||||
@ -32,6 +32,13 @@ in {
|
|||||||
# for neovim
|
# for neovim
|
||||||
nodejs
|
nodejs
|
||||||
ripgrep
|
ripgrep
|
||||||
|
|
||||||
|
] ++ [
|
||||||
|
pkgs-unstable.taskwarrior
|
||||||
|
# for taskwarrior
|
||||||
|
pkgs-unstable.taskwarrior-tui
|
||||||
|
pkgs-unstable.taskopen
|
||||||
|
pkgs-unstable.timewarrior
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
37
provision/nixos/modules/system/wireguard-client.nix
Normal file
37
provision/nixos/modules/system/wireguard-client.nix
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
{ config, lib, pkgs, user, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.system.wireguard-client;
|
||||||
|
|
||||||
|
in {
|
||||||
|
options.modules.system.wireguard-client = with lib; {
|
||||||
|
enable = lib.mkEnableOption "wireguard-client";
|
||||||
|
privateKeyFile = lib.mkOption { type = with types; str; };
|
||||||
|
address = lib.mkOption { type = with types; listOf str; };
|
||||||
|
publicKey = lib.mkOption { type = with types; str; };
|
||||||
|
endpoint = lib.mkOption { type = with types; str; };
|
||||||
|
autostart = lib.mkOption {
|
||||||
|
type = with types; bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
networking.firewall = {
|
||||||
|
allowedUDPPorts = [ 51820 ];
|
||||||
|
};
|
||||||
|
networking.wg-quick.interfaces = {
|
||||||
|
wg0 = {
|
||||||
|
address = cfg.address;
|
||||||
|
listenPort = 51820;
|
||||||
|
privateKeyFile = cfg.privateKeyFile;
|
||||||
|
autostart = cfg.autostart;
|
||||||
|
peers = [{
|
||||||
|
publicKey = cfg.publicKey;
|
||||||
|
allowedIPs = [ "0.0.0.0/0" "::/0" ];
|
||||||
|
endpoint = "${cfg.endpoint}:51820";
|
||||||
|
persistentKeepalive = 25;
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user