Skip to content

Commit 5508874

Browse files
authored
Merge pull request #62 from Radvendii/master
fix error on bad / unset $SHELL
2 parents 8b938d0 + 10d4286 commit 5508874

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

share/modules/nixos-shell-config.nix

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@ in {
1212

1313
# fish seems to do funky stuff: https://github.com/Mic92/nixos-shell/issues/42
1414
shell = if shell' == "fish" then "bash" else shell';
15-
in
16-
lib.mkMerge [
1715
# Enable the module of the user's shell for some sensible defaults.
18-
(lib.mkIf (options.programs ? ${shell}.enable && shell != "bash") {
16+
maybeSetShell = lib.optional (options.programs ? ${shell}.enable && shell != "bash") {
1917
programs.${shell}.enable = mkVMDefault true;
20-
})
21-
18+
};
19+
in
20+
lib.mkMerge (maybeSetShell ++ [
2221
(lib.mkIf (pkgs ? ${shell}) {
2322
users.extraUsers.root.shell = mkVMDefault pkgs.${shell};
2423
})
@@ -127,5 +126,5 @@ in {
127126

128127
networking.firewall.enable = mkVMDefault false;
129128
}
130-
];
129+
]);
131130
}

0 commit comments

Comments
 (0)