Skip to content

Commit 631b7f6

Browse files
committed
Add support for the other shells
1 parent 59296fb commit 631b7f6

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

nixos/modules/config/users-groups.nix

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -693,17 +693,20 @@ in {
693693
users.groups.${user.name} = {};
694694
'';
695695
}
696-
{
697-
assertion = (user.shell == pkgs.fish) -> (config.programs.fish.enable == true);
696+
] ++ (map (shell: {
697+
assertion = (user.shell == pkgs.${shell}) -> (config.programs.${shell}.enable == true);
698698
message = ''
699-
users.users.${user.name}.shell is set to fish, but
700-
programs.fish.enable is not true. This will cause the fish shell
701-
to lack the basic nix directories in its PATH and might make
699+
users.users.${user.name}.shell is set to ${shell}, but
700+
programs.${shell}.enable is not true. This will cause the ${shell}
701+
shell to lack the basic nix directories in its PATH and might make
702702
logging in as that user impossible. You can fix it with:
703-
programs.fish.enable = true;
703+
programs.${shell}.enable = true;
704704
'';
705-
}
706-
]
705+
}) [
706+
"fish"
707+
"xonsh"
708+
"zsh"
709+
])
707710
));
708711

709712
warnings =

0 commit comments

Comments
 (0)