From 1fc6891dc6fd73cbdebdd88ae7978a7d5020a562 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Mon, 18 Sep 2023 17:19:28 +0200 Subject: [PATCH] Remove nix-daemon.socket dependency of /nix/store The dependency causes a cycle as the nix store will be mounted after the network is ready, which itself depends on the socket.target which requires the nix-daemon.socket to be ready too. --- m/module/shared-nix-store.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/m/module/shared-nix-store.nix b/m/module/shared-nix-store.nix index 0b17fea..af9c147 100644 --- a/m/module/shared-nix-store.nix +++ b/m/module/shared-nix-store.nix @@ -4,6 +4,17 @@ # from being able to mount it. boot.readOnlyNixStore = false; + # The nix-daemon.socket has an unnecessary dependency over the /nix/store + # mount point. But that mount point won't be provided until the network is + # ready. However, the network-address-eno1.service, has a dependency over + # sockets.target, causing a cycle. + # One solution is to make the nix-daemon.socket depend only on the socket + # patch (which is already covered by ConditionPathIsReadWrite = + # /nix/var/nix/daemon-socket), instead on the /nix/store. + systemd.sockets.nix-daemon.unitConfig = { + RequiresMountsFor = "/nix/var/nix/daemon-socket"; + }; + # Mount the hut nix store via NFS in read-only mode. fileSystems."/mnt/hut-nix-store" = { device = "hut:/nix/store";