File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,23 +24,37 @@ with lib; {
2424 user . default = config . users . users . ${ cfg . defaultUser } . name ;
2525 boot . systemd = true ;
2626 } ;
27+ extraBin = [
28+ { src = "${ pkgs . shadow } /bin/login" ; }
29+ ] ;
2730 } ;
2831
2932 system . activationScripts = {
3033 createBootedSystemSymlink = stringAfter [ "specialfs" "users" "groups" ] ''
3134 echo "setting up /run/booted-system..."
3235 [[ -e /run/booted-system ]] || ln -sfn "$(readlink -f "$systemConfig")" /run/booted-system
3336 '' ;
34- shimSystemd = stringAfter [ ] ''
37+ createSbin = stringAfter ( optional cfg . populateBin "populateBin" ) (
38+ if cfg . populateBin
39+ then ''
40+ echo "setting up /sbin..."
41+ if [ ! -L /sbin ]; then
42+ rm -rf /sbin
43+ ln -s /bin /sbin
44+ fi
45+ ''
46+ else ''
47+ echo "setting up /sbin..."
48+ if [ ! -d /sbin ]; then
49+ rm -rf /sbin
50+ mkdir -p /sbin
51+ fi
52+ ''
53+ ) ;
54+ shimSystemd = stringAfter [ "createSbin" ] ''
3555 echo "setting up /sbin/init shim..."
36- mkdir -p /sbin
3756 ln -sf ${ config . system . build . nativeUtils } /bin/systemd-shim /sbin/init
3857 '' ;
39- setupLogin = lib . mkIf cfg . populateBin ( stringAfter [ ] ''
40- echo "setting up /bin/login..."
41- mkdir -p /bin
42- ln -sf ${ pkgs . shadow } /bin/login /bin/login
43- '' ) ;
4458 } ;
4559
4660 environment = {
You can’t perform that action at this time.
0 commit comments