diff --git a/machines/cherry/network-wireguard-wg1.nix b/machines/cherry/network-wireguard-wg1.nix index 88e3c67..948c210 100644 --- a/machines/cherry/network-wireguard-wg1.nix +++ b/machines/cherry/network-wireguard-wg1.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, config, ... }: { clan.core.facts.services.wg1 = { secret."wg1.conf" = { }; @@ -12,8 +12,11 @@ ''; }; }; - home-manager.users.root.packages = [ - (pkgs.writers.writeBashBin "wg1-connect" '' + home-manager.users.root.home.packages = [ + (pkgs.writers.writeBashBin "wg1-up" '' + ${pkgs.wireguard-tools}/bin/wg-quick up ${config.clan.core.facts.services.wg1.secret."wg1.conf".path} + '') + (pkgs.writers.writeBashBin "wg1-down" '' ${pkgs.wireguard-tools}/bin/wg-quick up ${config.clan.core.facts.services.wg1.secret."wg1.conf".path} '') ]; diff --git a/machines/cream/network-wireguard-wg1.nix b/machines/cream/network-wireguard-wg1.nix index 88e3c67..948c210 100644 --- a/machines/cream/network-wireguard-wg1.nix +++ b/machines/cream/network-wireguard-wg1.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, config, ... }: { clan.core.facts.services.wg1 = { secret."wg1.conf" = { }; @@ -12,8 +12,11 @@ ''; }; }; - home-manager.users.root.packages = [ - (pkgs.writers.writeBashBin "wg1-connect" '' + home-manager.users.root.home.packages = [ + (pkgs.writers.writeBashBin "wg1-up" '' + ${pkgs.wireguard-tools}/bin/wg-quick up ${config.clan.core.facts.services.wg1.secret."wg1.conf".path} + '') + (pkgs.writers.writeBashBin "wg1-down" '' ${pkgs.wireguard-tools}/bin/wg-quick up ${config.clan.core.facts.services.wg1.secret."wg1.conf".path} '') ];