Merge branch 'master' into f/activation
This commit is contained in:
@@ -174,14 +174,6 @@ in
|
||||
''
|
||||
# Various log/runtime directories.
|
||||
|
||||
mkdir -m 0755 -p /run/nix/current-load # for distributed builds
|
||||
mkdir -m 0700 -p /run/nix/remote-stores
|
||||
|
||||
mkdir -m 0755 -p /var/log
|
||||
|
||||
touch /var/log/wtmp /var/log/lastlog # must exist
|
||||
chmod 644 /var/log/wtmp /var/log/lastlog
|
||||
|
||||
mkdir -m 1777 -p /var/tmp
|
||||
|
||||
# Empty, immutable home directory of many system accounts.
|
||||
|
||||
@@ -419,8 +419,8 @@ while (my $f = <$listActiveUsers>) {
|
||||
my ($uid, $name) = ($+{uid}, $+{user});
|
||||
print STDERR "reloading user units for $name...\n";
|
||||
|
||||
system("su", "-s", "@shell@", "-l", $name, "-c", "XDG_RUNTIME_DIR=/run/user/$uid @systemd@/bin/systemctl --user daemon-reload");
|
||||
system("su", "-s", "@shell@", "-l", $name, "-c", "XDG_RUNTIME_DIR=/run/user/$uid @systemd@/bin/systemctl --user start nixos-activation.service");
|
||||
system("@su@", "-s", "@shell@", "-l", $name, "-c", "XDG_RUNTIME_DIR=/run/user/$uid @systemd@/bin/systemctl --user daemon-reload");
|
||||
system("@su@", "-s", "@shell@", "-l", $name, "-c", "XDG_RUNTIME_DIR=/run/user/$uid @systemd@/bin/systemctl --user start nixos-activation.service");
|
||||
}
|
||||
|
||||
close $listActiveUsers;
|
||||
|
||||
@@ -109,6 +109,7 @@ let
|
||||
inherit (pkgs) utillinux coreutils;
|
||||
systemd = config.systemd.package;
|
||||
shell = "${pkgs.bash}/bin/sh";
|
||||
su = "${pkgs.shadow.su}/bin/su";
|
||||
|
||||
inherit children;
|
||||
kernelParams = config.boot.kernelParams;
|
||||
|
||||
@@ -152,6 +152,14 @@ ln -sfn /run/booted-system /nix/var/nix/gcroots/booted-system
|
||||
@shell@ @postBootCommands@
|
||||
|
||||
|
||||
# Ensure systemd doesn't try to populate /etc, by forcing its first-boot
|
||||
# heuristic off. It doesn't matter what's in /etc/machine-id for this purpose,
|
||||
# and systemd will immediately fill in the file when it starts, so just
|
||||
# creating it is enough. This `: >>` pattern avoids forking and avoids changing
|
||||
# the mtime if the file already exists.
|
||||
: >> /etc/machine-id
|
||||
|
||||
|
||||
# Reset the logging file descriptors.
|
||||
exec 1>&$logOutFd 2>&$logErrFd
|
||||
exec {logOutFd}>&- {logErrFd}>&-
|
||||
|
||||
@@ -394,7 +394,7 @@ in rec {
|
||||
Each attribute in this set specifies an option in the
|
||||
<literal>[Timer]</literal> section of the unit. See
|
||||
<citerefentry><refentrytitle>systemd.timer</refentrytitle>
|
||||
<manvolnum>7</manvolnum></citerefentry> and
|
||||
<manvolnum>5</manvolnum></citerefentry> and
|
||||
<citerefentry><refentrytitle>systemd.time</refentrytitle>
|
||||
<manvolnum>7</manvolnum></citerefentry> for details.
|
||||
'';
|
||||
|
||||
@@ -747,6 +747,7 @@ in
|
||||
|
||||
"systemd/journald.conf".text = ''
|
||||
[Journal]
|
||||
Storage=persistent
|
||||
RateLimitInterval=${config.services.journald.rateLimitInterval}
|
||||
RateLimitBurst=${toString config.services.journald.rateLimitBurst}
|
||||
${optionalString (config.services.journald.console != "") ''
|
||||
@@ -783,19 +784,6 @@ in
|
||||
|
||||
services.dbus.enable = true;
|
||||
|
||||
system.activationScripts.systemd = stringAfter [ "groups" ]
|
||||
''
|
||||
mkdir -m 0755 -p /var/lib/udev
|
||||
|
||||
if ! [ -e /etc/machine-id ]; then
|
||||
${systemd}/bin/systemd-machine-id-setup
|
||||
fi
|
||||
|
||||
# Keep a persistent journal. Note that systemd-tmpfiles will
|
||||
# set proper ownership/permissions.
|
||||
mkdir -m 0700 -p /var/log/journal
|
||||
'';
|
||||
|
||||
users.users.systemd-network.uid = config.ids.uids.systemd-network;
|
||||
users.groups.systemd-network.gid = config.ids.gids.systemd-network;
|
||||
users.users.systemd-resolve.uid = config.ids.uids.systemd-resolve;
|
||||
|
||||
Reference in New Issue
Block a user