From 7d1baf7eb5bb5d2d1623414bd8a5ddb0f75e39f4 Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Tue, 14 Jan 2025 12:33:21 +0100 Subject: [PATCH] options: use mkIf for assertions --- modules/options/profiles/desktop.nix | 2 +- modules/options/profiles/gaming.nix | 2 +- modules/options/profiles/server.nix | 2 +- modules/options/style.nix | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/options/profiles/desktop.nix b/modules/options/profiles/desktop.nix index 62e8742..5b0fb45 100644 --- a/modules/options/profiles/desktop.nix +++ b/modules/options/profiles/desktop.nix @@ -9,7 +9,7 @@ in { local.profiles.desktop.enable = mkEnableOption "the desktop profile"; }; - config.assertions = [ + config.assertions = lib.mkIf config.local.profiles.desktop.enable [ { assertion = !config.local.profiles.server.enable; message = "The desktop profile cannot be enabled if `local.profiles.server.enable` is set to true."; diff --git a/modules/options/profiles/gaming.nix b/modules/options/profiles/gaming.nix index 9e4d1c9..b434b8f 100644 --- a/modules/options/profiles/gaming.nix +++ b/modules/options/profiles/gaming.nix @@ -9,7 +9,7 @@ in { local.profiles.gaming.enable = mkEnableOption "the gaming profile"; }; - config.assertions = [ + config.assertions = lib.mkIf config.local.profiles.gaming.enable [ { assertion = !config.local.profiles.server.enable; message = "The gaming profile cannot be enabled if `local.profiles.server.enable` is set to true."; diff --git a/modules/options/profiles/server.nix b/modules/options/profiles/server.nix index 46c4ea2..a772aff 100644 --- a/modules/options/profiles/server.nix +++ b/modules/options/profiles/server.nix @@ -9,7 +9,7 @@ in { local.profiles.server.enable = mkEnableOption "the server profile"; }; - config.assertions = [ + config.assertions = lib.mkIf config.local.profiles.server.enable [ { assertion = !config.local.profiles.desktop.enable; message = "The server profile cannot be enabled if `local.profiles.desktop.enable` is set to true."; diff --git a/modules/options/style.nix b/modules/options/style.nix index 63a9a09..ee20d63 100644 --- a/modules/options/style.nix +++ b/modules/options/style.nix @@ -111,7 +111,7 @@ in { }; }; - config = { + config = lib.mkIf cfg.enable { assertions = [ (let themePath = cfg.gtk.theme.package + /share/themes + "/${cfg.gtk.theme.name}";