update wg1 scripts
Some checks failed
Build all NixOS Configurations / nix build (push) Has been cancelled

This commit is contained in:
Ingolf Wagner 2024-08-07 09:14:26 +02:00
parent ccec2860ec
commit 88f8ead311
Signed by: palo
GPG key ID: 76BF5F1928B9618B
2 changed files with 12 additions and 6 deletions

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: { pkgs, config, ... }:
{ {
clan.core.facts.services.wg1 = { clan.core.facts.services.wg1 = {
secret."wg1.conf" = { }; secret."wg1.conf" = { };
@ -12,8 +12,11 @@
''; '';
}; };
}; };
home-manager.users.root.packages = [ home-manager.users.root.home.packages = [
(pkgs.writers.writeBashBin "wg1-connect" '' (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} ${pkgs.wireguard-tools}/bin/wg-quick up ${config.clan.core.facts.services.wg1.secret."wg1.conf".path}
'') '')
]; ];

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: { pkgs, config, ... }:
{ {
clan.core.facts.services.wg1 = { clan.core.facts.services.wg1 = {
secret."wg1.conf" = { }; secret."wg1.conf" = { };
@ -12,8 +12,11 @@
''; '';
}; };
}; };
home-manager.users.root.packages = [ home-manager.users.root.home.packages = [
(pkgs.writers.writeBashBin "wg1-connect" '' (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} ${pkgs.wireguard-tools}/bin/wg-quick up ${config.clan.core.facts.services.wg1.secret."wg1.conf".path}
'') '')
]; ];