options: use mkIf for assertions
This commit is contained in:
parent
9b01b40253
commit
7d1baf7eb5
4 changed files with 4 additions and 4 deletions
|
@ -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.";
|
||||||
|
|
|
@ -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.";
|
||||||
|
|
|
@ -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.";
|
||||||
|
|
|
@ -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}";
|
||||||
|
|
Loading…
Reference in a new issue