Revert "remove wireguard stuff"
This reverts commit9b8ec24c63
. This reverts commitec04addf62
.
This commit is contained in:
parent
cf79a1c98d
commit
c034a10aef
6 changed files with 49 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
|||
{lib, ...}: {
|
||||
imports = [./wireguard.nix];
|
||||
networking = {
|
||||
hostName = "Rico2";
|
||||
useDHCP = lib.mkDefault false;
|
||||
|
|
23
hosts/rico2/wireguard.nix
Normal file
23
hosts/rico2/wireguard.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
config,
|
||||
secrets,
|
||||
...
|
||||
}: let
|
||||
inherit (secrets.wireguard_config) peers;
|
||||
in {
|
||||
networking.wireguard = {
|
||||
enable = true;
|
||||
interfaces = {
|
||||
wg0 = {
|
||||
ips = peers."${config.networking.hostName}".allowedIPs;
|
||||
privateKeyFile = "/etc/wireguard/private.key";
|
||||
generatePrivateKeyFile = true;
|
||||
listenPort = 51820;
|
||||
peers = with peers; [
|
||||
Proxy
|
||||
Skipper
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
{lib, ...}: {
|
||||
imports = [./wireguard.nix];
|
||||
networking = {
|
||||
hostName = "Skipper";
|
||||
networkmanager = {
|
||||
|
|
|
@ -5,6 +5,7 @@ _: {
|
|||
"/etc/secureboot"
|
||||
"/etc/ssh/keys"
|
||||
"/etc/systemd/nspawn"
|
||||
"/etc/wireguard"
|
||||
"/root/.cache/nix"
|
||||
"/var/cache/apparmor"
|
||||
"/var/cache/fwupd"
|
||||
|
|
23
hosts/skipper/wireguard.nix
Normal file
23
hosts/skipper/wireguard.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
config,
|
||||
secrets,
|
||||
...
|
||||
}: let
|
||||
inherit (secrets.wireguard_config) peers;
|
||||
in {
|
||||
networking.wireguard = {
|
||||
enable = true;
|
||||
interfaces = {
|
||||
wg0 = {
|
||||
ips = peers."${config.networking.hostName}".allowedIPs;
|
||||
privateKeyFile = "/etc/wireguard/private.key";
|
||||
generatePrivateKeyFile = true;
|
||||
listenPort = 51820;
|
||||
peers = with peers; [
|
||||
Proxy
|
||||
Rico2
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
BIN
secrets.nix
BIN
secrets.nix
Binary file not shown.
Loading…
Reference in a new issue