From 435cdd10ecf143d0592fc544bb8252b4b02edb96 Mon Sep 17 00:00:00 2001 From: rasmus-kirk Date: Sat, 24 Feb 2024 21:30:00 +0100 Subject: [PATCH] Fixed some bugs --- nixarr/default.nix | 6 +++--- util/vpnNamespace/default.nix | 34 +++++++++++++++------------------- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/nixarr/default.nix b/nixarr/default.nix index 4684798..ea71144 100644 --- a/nixarr/default.nix +++ b/nixarr/default.nix @@ -55,7 +55,7 @@ in { }; vpn = { - enable = mkEnableOption ''Enable vpn''; + enable = mkEnableOption "Enable vpn"; wgConf = mkOption { type = types.nullOr types.path; @@ -150,7 +150,7 @@ in { }; transmission = { isSystemUser = true; - group = "transmission"; + group = "media"; uid = lib.mkForce 70; }; prowlarr = { @@ -190,7 +190,7 @@ in { ]; util-nixarr.vpnnamespace = { - enable = true; + enable = cfg.vpn.enable; accessibleFrom = [ "192.168.1.0/24" "127.0.0.1" diff --git a/util/vpnNamespace/default.nix b/util/vpnNamespace/default.nix index 43a861f..4bb14ac 100644 --- a/util/vpnNamespace/default.nix +++ b/util/vpnNamespace/default.nix @@ -13,29 +13,25 @@ with lib; let cfg = config.util-nixarr.vpnnamespace; in { options.util-nixarr.vpnnamespace = { - enable = - mkEnableOption (lib.mdDoc "VPN Namespace") - // { - description = lib.mdDoc '' - Whether to enable the VPN namespace. + enable = mkEnableOption '' + Whether to enable the VPN namespace. - To access the namespace a veth pair is used to - connect the vpn namespace and the default namespace - through a linux bridge. One end of the pair is - connected to the linux bridge on the default namespace. - The other end is connected to the vpn namespace. + To access the namespace a veth pair is used to + connect the vpn namespace and the default namespace + through a linux bridge. One end of the pair is + connected to the linux bridge on the default namespace. + The other end is connected to the vpn namespace. - Systemd services can be run within the namespace by - adding these options: + Systemd services can be run within the namespace by + adding these options: - bindsTo = [ "netns@wg.service" ]; - requires = [ "network-online.target" ]; - after = [ "wg.service" ]; - serviceConfig = { - NetworkNamespacePath = "/var/run/netns/wg"; - }; - ''; + bindsTo = [ "netns@wg.service" ]; + requires = [ "network-online.target" ]; + after = [ "wg.service" ]; + serviceConfig = { + NetworkNamespacePath = "/var/run/netns/wg"; }; + ''; accessibleFrom = mkOption { type = types.listOf types.str;