From 140178d58ec12df71e31747850337cc64d70ae9c Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Mon, 18 Sep 2023 11:22:24 +0200 Subject: [PATCH] Begin the nix store overlay We need to disable the read-only bind mount, so we can directly bind mount the overlay. --- m/module/shared-nix-store.nix | 18 ++++++++++++++++++ m/owl1/configuration.nix | 1 + m/owl2/configuration.nix | 1 + 3 files changed, 20 insertions(+) create mode 100644 m/module/shared-nix-store.nix diff --git a/m/module/shared-nix-store.nix b/m/module/shared-nix-store.nix new file mode 100644 index 0000000..1c19fd9 --- /dev/null +++ b/m/module/shared-nix-store.nix @@ -0,0 +1,18 @@ +{ ... }: +{ + # Don't make the nix store read-only, as this would prevent the overlay FS + # from being able to mount it. + boot.readOnlyNixStore = false; + + # Mount the hut nix store via NFS + fileSystems."/mnt/hut-nix-store" = { + device = "hut:/nix/store"; + fsType = "nfs"; + options = [ "ro" ]; + }; + + # Create the work directory + #systemd.tmpfiles.rules = [ + # "d /mnt/nix-overlay/work 0550 1000 root root -" + #]; +} diff --git a/m/owl1/configuration.nix b/m/owl1/configuration.nix index 5afda72..052ea8a 100644 --- a/m/owl1/configuration.nix +++ b/m/owl1/configuration.nix @@ -5,6 +5,7 @@ ../common/main.nix ../module/ceph.nix ../module/slurm-firewall.nix + ../module/shared-nix-store.nix ]; # Select the this using the ID to avoid mismatches diff --git a/m/owl2/configuration.nix b/m/owl2/configuration.nix index 9636760..ce95fa2 100644 --- a/m/owl2/configuration.nix +++ b/m/owl2/configuration.nix @@ -5,6 +5,7 @@ ../common/main.nix ../module/ceph.nix ../module/slurm-firewall.nix + ../module/shared-nix-store.nix ]; # Select the this using the ID to avoid mismatches