fix: including disabled wireguard settings

This commit is contained in:
Noah Masur 2023-06-18 03:24:35 +00:00
parent 0f4914db95
commit 13c7859a78
3 changed files with 14 additions and 6 deletions

View File

@ -41,6 +41,8 @@
"VDPAU_DRIVER" = "radeonsi";
"LIBVA_DRIVER_NAME" = "radeonsi";
};
users.users.jellyfin.extraGroups =
[ "render" "video" ]; # Access to /dev/dri
};

View File

@ -42,8 +42,10 @@
# Create reverse proxy for web UI
caddy.routes = lib.mkAfter [{
group =
lib.mkIf (config.arrServer == config.transmissionServer) "download";
group = if (config.arrServer == config.transmissionServer) then
"download"
else
"transmission";
match = [{
host = [ config.transmissionServer ];
path = [ "/transmission*" ];
@ -76,7 +78,7 @@
# Create credentials file for transmission
secrets.transmission = {
source = ../../private/transmission.json.age;
source = ../../../private/transmission.json.age;
dest = "${config.secretsDirectory}/transmission.json";
owner = "transmission";
group = "transmission";

View File

@ -2,13 +2,16 @@
options.wireguard.enable = lib.mkEnableOption "Wireguard VPN setup.";
config = lib.mkIf (pkgs.stdenv.isLinux && config.wireguard.enable) {
config = lib.mkIf (pkgs.stdenv.isLinux) {
networking.wireguard = {
enable = true;
enable = config.wireguard.enable;
interfaces = {
wg0 = {
# Something to use as a default value
ips = lib.mkDefault [ "127.0.0.1/32" ];
# Establishes identity of this machine
generatePrivateKeyFile = false;
privateKeyFile = config.secrets.wireguard.dest;
@ -23,6 +26,7 @@
# Create namespace for Wireguard
# This allows us to isolate specific programs to Wireguard
systemd.services."netns@" = {
enable = config.wireguard.enable;
description = "%I network namespace";
before = [ "network.target" ];
serviceConfig = {
@ -35,7 +39,7 @@
# Create private key file for wireguard
secrets.wireguard = {
source = ../../private/wireguard.age;
source = ../../../private/wireguard.age;
dest = "${config.secretsDirectory}/wireguard";
};