diff --git a/profiles/user0/default.nix b/profiles/user0/default.nix index aa1fb43..967ebc1 100755 --- a/profiles/user0/default.nix +++ b/profiles/user0/default.nix @@ -53,23 +53,26 @@ in mars = devices.mars; deimos = devices.deimos; deviceLogic = if hostname == mars.name then deimos else mars; + + vpnServers = [ + "CA363" + "CA220" + "CA358" + "CA627" + ]; + + vpnCommands = lib.concatStrings ( + lib.imap0 (i: server: '' + vpn${toString i}: + sudo systemctl start wg-quick-Proton-${server}.service + + '') vpnServers + ); in { text = '' - vpn0: - sudo systemctl start wg-quick-Proton-CA363.service - - vpn1: - sudo systemctl start wg-quick-Proton-CA220.service - - vpn2: - sudo systemctl start wg-quick-Proton-CA358.service - - vpn3: - sudo systemctl start wg-quick-Proton-CA627.service - - vpnoff: - sudo systemctl stop wg-quick-Proton-*.service + rebuildboot: + nixos-rebuild boot --use-remote-sudo --flake ~/Files/Projects/dotfiles#${hostname} --show-trace rebuild: nixos-rebuild switch --use-remote-sudo --flake ~/Files/Projects/dotfiles#${hostname} --show-trace @@ -85,6 +88,11 @@ in ${deviceLogic.name}: ssh ${deviceLogic.ip.address0} + + vpnoff: + sudo systemctl stop wg-quick-Proton-*.service + + ${vpnCommands} ''; }; "./Files/Scripts/list.sh" = {