From 24174216153b0cf3e3abbaf8f8b5abe556dac4f8 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Fri, 5 Feb 2021 00:06:17 +0100 Subject: [PATCH] setupSystemdUnits: use /nix/var/nix/profiles/default/lib/systemd/system as fallback The previous commit stopped systemd from looking for system units in /etc/systemd-mutable/system, which was a Dysnomia-specific path. While this script doesn't seem to be used anywhere inside nixpkgs (also not in the gone-since #110799 Dysnomia), its fallback mode (when /etc/systemd/system is read-only) did write units to that Dysnomia-specific path, which systemd now doesn't look at anymore. It might be up for another debate on whether systems with read-only /etc/systemd/system should probably just use /run/systemd/system, and not some NixOS-specific paths, as such conditions can happen on other distros too, but let's pick the other NixOS-specific path /nix/var/nix/profiles/default/lib/systemd/system for now, which is probably better than a path that surely is never looked at. --- pkgs/build-support/setup-systemd-units.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/setup-systemd-units.nix b/pkgs/build-support/setup-systemd-units.nix index 4fa2f42c39dc..4c7ee86669f5 100644 --- a/pkgs/build-support/setup-systemd-units.nix +++ b/pkgs/build-support/setup-systemd-units.nix @@ -58,7 +58,7 @@ unitDir=/etc/systemd/system if [ ! -w "$unitDir" ]; then - unitDir=/etc/systemd-mutable/system + unitDir=/nix/var/nix/profiles/default/lib/systemd/system mkdir -p "$unitDir" fi declare -a unitsToStop unitsToStart