From 92298b4bd7d2d310b2ffb3524bdc740bb5d3665f Mon Sep 17 00:00:00 2001 From: servostar Date: Sat, 18 Nov 2023 11:33:43 +0100 Subject: [PATCH] moved wireguard to extra --- boot.nix | 3 +-- configuration.nix | 8 -------- extra/default.nix | 1 + extra/wireguard.nix | 15 +++++++++++++++ 4 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 extra/wireguard.nix diff --git a/boot.nix b/boot.nix index cfe4f72..a1247c0 100644 --- a/boot.nix +++ b/boot.nix @@ -32,7 +32,6 @@ # extra enabled kernel modules boot.kernelModules = [ "sg" # for generic SCSI devices such as /dev/sg0 - "wireguard" ]; # Kernel parameter on boot @@ -47,4 +46,4 @@ boot.initrd.secrets = { "/crypto_keyfile.bin" = null; }; -} \ No newline at end of file +} diff --git a/configuration.nix b/configuration.nix index 5cf523c..24c9817 100644 --- a/configuration.nix +++ b/configuration.nix @@ -38,8 +38,6 @@ in # networking.proxy.default = "http://user:password@proxy:port/"; # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - networking.wireguard.enable = true; - # Enable networking networking.networkmanager.enable = true; @@ -235,12 +233,6 @@ in # Enable the OpenSSH daemon. # services.openssh.enable = true; - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - networking.firewall.allowedUDPPorts = [ - 51820 # wireguard client - ]; # Or disable the firewall altogether. # networking.firewall.enable = false; diff --git a/extra/default.nix b/extra/default.nix index c97b799..1da134f 100644 --- a/extra/default.nix +++ b/extra/default.nix @@ -4,6 +4,7 @@ ./dvd.nix ./yubikey.nix ./platformio.nix + ./wireguard.nix ./language-server.nix ]; } diff --git a/extra/wireguard.nix b/extra/wireguard.nix new file mode 100644 index 0000000..e28d9aa --- /dev/null +++ b/extra/wireguard.nix @@ -0,0 +1,15 @@ +{ pkgs, config, ... }: { + + networking.wireguard.enable = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + networking.firewall.allowedUDPPorts = [ + 51820 # wireguard client + ]; + + boot.kernelModules = [ + "wireguard" + ]; +}