Add assertion that zsh is installed if we set it as our default shell

This commit is contained in:
Joshua Yuen 2025-08-21 19:17:20 -04:00
parent 2710f8988c
commit 8998c1078b
Signed by: josh
GPG Key ID: 502720BC22ED411C
2 changed files with 10 additions and 1 deletions

View File

@ -23,7 +23,7 @@
modules.displayManager.displayManager = "gdm";
modules.zsh.enable = true;
modules.shell.defaultShell = "bash";
modules.shell.defaultShell = "zsh";
modules.pipewire.enable = true;
}

View File

@ -6,6 +6,7 @@
with lib;
let
cfg = config.modules.shell;
zshCfg = config.modules.zsh;
in
{
options.modules.shell = {
@ -20,4 +21,12 @@ in
'';
};
};
config.assertions = []
++ (if cfg.defaultShell == "zsh"
then [{
assertion = zshCfg.enable;
message = "You have selected zsh as the default shell, but you haven't enabled it in your configuration.\n\nPlease enable it by adding `modules.zsh.enable = true`.";
}]
else []);
}