diff --git a/m/module/shared-nix-store.nix b/m/module/shared-nix-store.nix index 225bdc0..cde993b 100644 --- a/m/module/shared-nix-store.nix +++ b/m/module/shared-nix-store.nix @@ -25,7 +25,27 @@ fileSystems."/nix//store" = { device = "overlay"; fsType = "overlay"; - options = [ "lowerdir=/mnt/hut-nix-store,upperdir=/nix/store,workdir=/mnt/nix-work" ]; + options = [ + "lowerdir=/mnt/hut-nix-store,upperdir=/nix/store,workdir=/mnt/nix-work" + "x-systemd.requires-mounts-for=/nix/store" + # We need to wait for the NFS mount + "x-systemd.requires-mounts-for=/mnt/hut-nix-store" + ]; depends = [ "/nix/store" "/mnt/hut-nix-store" "/mnt/nix-work" ]; }; + + # Maybe we should move it to a systemd mount, so we avoid the /nix//store + # hack. Example (not tested): + # systemd.mounts = [ + # { + # what = "overlay"; + # type = "overlay"; + # where = "/nix/store"; + # options = "lowerdir=/mnt/hut-nix-store,upperdir=/nix/store,workdir=/mnt/nix-work"; + # description = "Overlay nix store mount"; + # requires = [ "hut-nix-store.mount" ]; + # after = [ "mnt-hut\\x2dnix\\x2dstore.mount" ]; + # before = [ "nix-daemon.service" ]; + # } + # ]; }