Skip to content

Commit 59296fb

Browse files
committed
Assert that fish configuration is enabled if any user has fish as their shell.
Suggested-By: matthiasbeyer
1 parent 486c531 commit 59296fb

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

nixos/modules/config/users-groups.nix

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,16 @@ in {
693693
users.groups.${user.name} = {};
694694
'';
695695
}
696+
{
697+
assertion = (user.shell == pkgs.fish) -> (config.programs.fish.enable == true);
698+
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
702+
logging in as that user impossible. You can fix it with:
703+
programs.fish.enable = true;
704+
'';
705+
}
696706
]
697707
));
698708

0 commit comments

Comments
 (0)