From 237696dac0e45b2c3efe230a16eb3f59ee9ddd4b Mon Sep 17 00:00:00 2001 From: rasmus-kirk Date: Tue, 27 Feb 2024 07:20:18 +0100 Subject: [PATCH] Testing assertions --- nixarr/jellyfin/default.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/nixarr/jellyfin/default.nix b/nixarr/jellyfin/default.nix index 7534487..9cfd29d 100644 --- a/nixarr/jellyfin/default.nix +++ b/nixarr/jellyfin/default.nix @@ -3,12 +3,12 @@ lib, ... }: -with lib; let +let cfg = config.nixarr.jellyfin; defaultPort = 8096; nixarr = config.nixarr; dnsServers = config.lib.vpn.dnsServers; -in { +in with lib; { options.nixarr.jellyfin = { enable = mkEnableOption "the Jellyfin service."; @@ -106,10 +106,17 @@ in { config = # TODO: this doesn't work. I don't know why :( - #assert (!(cfg.vpn.enable && cfg.expose.enable)) || abort "vpn.enable not compatible with expose.enable."; + assert (!(cfg.vpn.enable && cfg.expose.https.enable)) || abort "vpn.enable not compatible with expose.enable."; #assert (cfg.expose.enable -> (cfg.expose.domainName != null && cfg.expose.acmeMail != null)) || abort "Both expose.domain and expose.acmeMail needs to be set if expose.enable is set."; mkIf cfg.enable { + assertions = [ + { + assertion = !(cfg.vpn.enable && cfg.expose.https.enable); + message = "The vpn.enable option conflicts with the expose.enable option"; + } + ]; + systemd.tmpfiles.rules = [ "d '${cfg.stateDir}' 0700 streamer root - -" ];