fix binbash module to use mkIf properly
This commit is contained in:
parent
51b7cc742e
commit
baf04cc75d
|
@ -23,15 +23,16 @@ with lib;
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
system.activationScripts.binbash = if config.environment.binbash.enable
|
system.activationScripts.binbash = mkMerge [
|
||||||
then ''
|
(mkIf config.environment.binbash.enable ''
|
||||||
mkdir -m 0755 -p /bin
|
mkdir -m 0755 -p /bin
|
||||||
ln -sfn ${config.environment.binbash.bash}/bin/bash /bin/.bash.tmp
|
ln -sfn ${config.environment.binbash.bash}/bin/bash /bin/.bash.tmp
|
||||||
mv /bin/.bash.tmp /bin/bash # atomically replace /usr/bin/env
|
mv /bin/.bash.tmp /bin/bash # atomically replace
|
||||||
''
|
'')
|
||||||
else ''
|
(mkIf (! config.environment.binbash.enable) ''
|
||||||
rm -f /bin/bash
|
rm -f /bin/bash
|
||||||
'';
|
'')
|
||||||
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user