options: use mkIf for assertions

This commit is contained in:
Anthony Rodriguez 2025-01-14 12:33:21 +01:00
parent 9b01b40253
commit 7d1baf7eb5
Signed by: nezia
GPG key ID: EE3BE97C040A86CE
4 changed files with 4 additions and 4 deletions

View file

@ -9,7 +9,7 @@ in {
local.profiles.desktop.enable = mkEnableOption "the desktop profile"; 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; assertion = !config.local.profiles.server.enable;
message = "The desktop profile cannot be enabled if `local.profiles.server.enable` is set to true."; message = "The desktop profile cannot be enabled if `local.profiles.server.enable` is set to true.";

View file

@ -9,7 +9,7 @@ in {
local.profiles.gaming.enable = mkEnableOption "the gaming profile"; 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; assertion = !config.local.profiles.server.enable;
message = "The gaming profile cannot be enabled if `local.profiles.server.enable` is set to true."; message = "The gaming profile cannot be enabled if `local.profiles.server.enable` is set to true.";

View file

@ -9,7 +9,7 @@ in {
local.profiles.server.enable = mkEnableOption "the server profile"; 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; assertion = !config.local.profiles.desktop.enable;
message = "The server profile cannot be enabled if `local.profiles.desktop.enable` is set to true."; message = "The server profile cannot be enabled if `local.profiles.desktop.enable` is set to true.";

View file

@ -111,7 +111,7 @@ in {
}; };
}; };
config = { config = lib.mkIf cfg.enable {
assertions = [ assertions = [
(let (let
themePath = cfg.gtk.theme.package + /share/themes + "/${cfg.gtk.theme.name}"; themePath = cfg.gtk.theme.package + /share/themes + "/${cfg.gtk.theme.name}";