Revert "remove wireguard stuff"

This reverts commit 9b8ec24c63.
This reverts commit ec04addf62.
This commit is contained in:
Adithya 2023-10-10 18:25:21 +05:30
parent cf79a1c98d
commit c034a10aef
Signed by: adtya
GPG key ID: 48FC9915FFD326D0
6 changed files with 49 additions and 0 deletions

View file

@ -1,4 +1,5 @@
{lib, ...}: { {lib, ...}: {
imports = [./wireguard.nix];
networking = { networking = {
hostName = "Rico2"; hostName = "Rico2";
useDHCP = lib.mkDefault false; useDHCP = lib.mkDefault false;

23
hosts/rico2/wireguard.nix Normal file
View 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
];
};
};
};
}

View file

@ -1,4 +1,5 @@
{lib, ...}: { {lib, ...}: {
imports = [./wireguard.nix];
networking = { networking = {
hostName = "Skipper"; hostName = "Skipper";
networkmanager = { networkmanager = {

View file

@ -5,6 +5,7 @@ _: {
"/etc/secureboot" "/etc/secureboot"
"/etc/ssh/keys" "/etc/ssh/keys"
"/etc/systemd/nspawn" "/etc/systemd/nspawn"
"/etc/wireguard"
"/root/.cache/nix" "/root/.cache/nix"
"/var/cache/apparmor" "/var/cache/apparmor"
"/var/cache/fwupd" "/var/cache/fwupd"

View 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
];
};
};
};
}

Binary file not shown.