add wg1 (fritz.box) wireguard
This commit is contained in:
parent
695f8bae20
commit
e717d0081e
6 changed files with 44 additions and 2 deletions
|
@ -13,7 +13,8 @@
|
|||
|
||||
./network-tinc.nix
|
||||
./network-tinc_retiolum.nix
|
||||
./network-wireguard.nix
|
||||
./network-wireguard-wg0.nix
|
||||
./network-wireguard-wg0.nix
|
||||
|
||||
./37c3.nix
|
||||
|
||||
|
|
20
machines/cherry/network-wireguard-wg1.nix
Normal file
20
machines/cherry/network-wireguard-wg1.nix
Normal 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}
|
||||
'')
|
||||
];
|
||||
}
|
|
@ -13,7 +13,8 @@
|
|||
|
||||
./network-tinc.nix
|
||||
./network-tinc_retiolum.nix
|
||||
./network-wireguard.nix
|
||||
./network-wireguard-wg0.nix
|
||||
./network-wireguard-wg1.nix
|
||||
|
||||
];
|
||||
|
||||
|
|
20
machines/cream/network-wireguard-wg1.nix
Normal file
20
machines/cream/network-wireguard-wg1.nix
Normal 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}
|
||||
'')
|
||||
];
|
||||
}
|
Loading…
Reference in a new issue