nixos/activation-script: only setup nix tmpfiles if nix is enabled

If nix is not installed on the end system, the tmpfiles settings related
to it do not need to be setup.
This commit is contained in:
Jared Baur 2024-09-22 12:01:39 -07:00
parent 3d6e7d7b56
commit c39781c558
No known key found for this signature in database

View file

@ -234,11 +234,12 @@ in
system.activationScripts.var = ""; # obsolete
systemd.tmpfiles.rules = [
"D /var/empty 0555 root root -"
"h /var/empty - - - - +i"
] ++ lib.optionals config.nix.enable [
# Prevent the current configuration from being garbage-collected.
"d /nix/var/nix/gcroots -"
"L+ /nix/var/nix/gcroots/current-system - - - - /run/current-system"
"D /var/empty 0555 root root -"
"h /var/empty - - - - +i"
];
system.activationScripts.usrbinenv = if config.environment.usrbinenv != null