Skip to content

Commit

Permalink
Add support for the other shells
Browse files Browse the repository at this point in the history
  • Loading branch information
farcaller committed Jan 19, 2023
1 parent 59296fb commit 631b7f6
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions nixos/modules/config/users-groups.nix
Expand Up @@ -693,17 +693,20 @@ in {
users.groups.${user.name} = {};
'';
}
{
assertion = (user.shell == pkgs.fish) -> (config.programs.fish.enable == true);
] ++ (map (shell: {
assertion = (user.shell == pkgs.${shell}) -> (config.programs.${shell}.enable == true);
message = ''
users.users.${user.name}.shell is set to fish, but
programs.fish.enable is not true. This will cause the fish shell
to lack the basic nix directories in its PATH and might make
users.users.${user.name}.shell is set to ${shell}, but
programs.${shell}.enable is not true. This will cause the ${shell}
shell to lack the basic nix directories in its PATH and might make
logging in as that user impossible. You can fix it with:
programs.fish.enable = true;
programs.${shell}.enable = true;
'';
}
]
}) [
"fish"
"xonsh"
"zsh"
])
));

warnings =
Expand Down

0 comments on commit 631b7f6

Please sign in to comment.