update wg1 scripts

This commit is contained in:
Ingolf Wagner 2024-08-07 09:14:26 +02:00
parent ccec2860ec
commit db6e5d3828
No known key found for this signature in database
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 = {
secret."wg1.conf" = { };
@ -12,9 +12,12 @@
'';
};
};
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 down ${config.clan.core.facts.services.wg1.secret."wg1.conf".path}
'')
];
}

View file

@ -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}
'')
];