feat: set fish as user shell

This commit is contained in:
2025-12-07 11:51:19 +08:00
parent 3a82f9b652
commit 5d3fc65be5
3 changed files with 34 additions and 9 deletions

View File

@@ -0,0 +1,34 @@
{
lib,
config,
username,
...
}:
let
cfg = config.my.cli.shell;
in
{
options.my.cli.shell.default = lib.mkOption {
type = lib.types.enum [
"fish"
"zsh"
];
default = "fish";
};
config = lib.mkMerge [
(lib.mkIf (cfg.default == "fish") {
my.cli.shell.fish.enable = true;
users.users.${username} = {
shell = config.my.hm.programs.fish.package;
# do not need `programs.fish.enable = true` since fish is managed by home-manager
ignoreShellProgramCheck = true;
};
})
(lib.mkIf (cfg.default == "zsh") {
my.cli.shell.zsh.enable = true;
users.users.${username}.shell = config.my.hm.programs.zsh.package;
})
];
}