fix binbash module to use mkIf properly

This commit is contained in:
James Andariese 2022-09-27 11:17:40 -05:00
parent 51b7cc742e
commit baf04cc75d

View File

@ -23,15 +23,16 @@ with lib;
};
config = {
system.activationScripts.binbash = if config.environment.binbash.enable
then ''
system.activationScripts.binbash = mkMerge [
(mkIf config.environment.binbash.enable ''
mkdir -m 0755 -p /bin
ln -sfn ${config.environment.binbash.bash}/bin/bash /bin/.bash.tmp
mv /bin/.bash.tmp /bin/bash # atomically replace /usr/bin/env
''
else ''
mv /bin/.bash.tmp /bin/bash # atomically replace
'')
(mkIf (! config.environment.binbash.enable) ''
rm -f /bin/bash
'';
'')
];
};
}