Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions modules/systemd/native/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,37 @@ with lib; {
user.default = config.users.users.${cfg.defaultUser}.name;
boot.systemd = true;
};
extraBin = [
{ src = "${pkgs.shadow}/bin/login"; }
];
};

system.activationScripts = {
createBootedSystemSymlink = stringAfter [ "specialfs" "users" "groups" ] ''
echo "setting up /run/booted-system..."
[[ -e /run/booted-system ]] || ln -sfn "$(readlink -f "$systemConfig")" /run/booted-system
'';
shimSystemd = stringAfter [ ] ''
createSbin = stringAfter (optional cfg.populateBin "populateBin") (
if cfg.populateBin
then ''
echo "setting up /sbin..."
if [ ! -L /sbin ]; then
rm -rf /sbin
ln -s /bin /sbin
fi
''
else ''
echo "setting up /sbin..."
if [ ! -d /sbin ]; then
rm -rf /sbin
mkdir -p /sbin
fi
''
);
shimSystemd = stringAfter [ "createSbin" ] ''
echo "setting up /sbin/init shim..."
mkdir -p /sbin
ln -sf ${config.system.build.nativeUtils}/bin/systemd-shim /sbin/init
Comment thread
nzbr marked this conversation as resolved.
'';
setupLogin = lib.mkIf cfg.populateBin (stringAfter [ ] ''
echo "setting up /bin/login..."
mkdir -p /bin
ln -sf ${pkgs.shadow}/bin/login /bin/login
'');
};

environment = {
Expand Down
Loading