add wg1 (fritz.box) wireguard

This commit is contained in:
Ingolf Wagner 2024-08-07 08:14:09 +02:00
parent 695f8bae20
commit e717d0081e
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
6 changed files with 44 additions and 2 deletions

View file

@ -13,7 +13,8 @@
./network-tinc.nix ./network-tinc.nix
./network-tinc_retiolum.nix ./network-tinc_retiolum.nix
./network-wireguard.nix ./network-wireguard-wg0.nix
./network-wireguard-wg0.nix
./37c3.nix ./37c3.nix

View file

@ -0,0 +1,20 @@
{ pkgs, ... }:
{
clan.core.facts.services.wg1 = {
secret."wg1.conf" = { };
generator = {
# I download the config from my fritz.box
# cat wg_config.conf | pass insert -m machiens/<name>/wg1.conf
prompt = "please enter the wg1.conf";
path = with pkgs; [ coreutils ];
script = ''
echo "$prompt_value" > "$secrets"/wg1.conf
'';
};
};
home-manager.users.root.packages = [
(pkgs.writers.writeBashBin "wg1-connect" ''
${pkgs.wireguard-tools}/bin/wg-quick up ${config.clan.core.facts.services.wg1.secret."wg1.conf".path}
'')
];
}

View file

@ -13,7 +13,8 @@
./network-tinc.nix ./network-tinc.nix
./network-tinc_retiolum.nix ./network-tinc_retiolum.nix
./network-wireguard.nix ./network-wireguard-wg0.nix
./network-wireguard-wg1.nix
]; ];

View file

@ -0,0 +1,20 @@
{ pkgs, ... }:
{
clan.core.facts.services.wg1 = {
secret."wg1.conf" = { };
generator = {
# I download the config from my fritz.box
# cat wg_config.conf | pass insert -m machiens/<name>/wg1.conf
prompt = "please enter the wg1.conf";
path = with pkgs; [ coreutils ];
script = ''
echo "$prompt_value" > "$secrets"/wg1.conf
'';
};
};
home-manager.users.root.packages = [
(pkgs.writers.writeBashBin "wg1-connect" ''
${pkgs.wireguard-tools}/bin/wg-quick up ${config.clan.core.facts.services.wg1.secret."wg1.conf".path}
'')
];
}