From 9ca9fb8ae36d986ce57b39ffa0eb2717f74f44a4 Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Sat, 16 Nov 2024 19:30:35 +0530 Subject: [PATCH] skipper: symlink /etc/machine-id instead of bind-mount --- hosts/skipper/persistence/persistence.nix | 56 +++++++++++++---------- 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/hosts/skipper/persistence/persistence.nix b/hosts/skipper/persistence/persistence.nix index eedf5c5..dbadb6a 100644 --- a/hosts/skipper/persistence/persistence.nix +++ b/hosts/skipper/persistence/persistence.nix @@ -1,25 +1,35 @@ -_: { - environment.persistence."/persist/system" = { - hideMounts = true; - directories = [ - "/etc/NetworkManager/system-connections" - "/etc/systemd/nspawn" - "/root/.local/share/nix" - "/var/cache/fwupd" - "/var/lib/bluetooth" - "/var/lib/btrfs" - "/var/lib/fwupd" - "/var/lib/iwd" - "/var/lib/libvirt" - "/var/lib/machines" - "/var/lib/NetworkManager" - "/var/lib/nixos" - "/var/lib/portables" - "/var/lib/systemd" - "/var/log" - ]; - files = [ - "/etc/machine-id" - ]; +_: +let + persistant-path = "/persist/system"; +in +{ + environment = { + etc = { + "machine-id" = { + enable = true; + source = "${persistant-path}/machine-id"; + mode = "symlink"; + }; + }; + persistence."${persistant-path}" = { + hideMounts = true; + directories = [ + "/etc/NetworkManager/system-connections" + "/etc/systemd/nspawn" + "/root/.local/share/nix" + "/var/cache/fwupd" + "/var/lib/bluetooth" + "/var/lib/btrfs" + "/var/lib/fwupd" + "/var/lib/iwd" + "/var/lib/libvirt" + "/var/lib/machines" + "/var/lib/NetworkManager" + "/var/lib/nixos" + "/var/lib/portables" + "/var/lib/systemd" + "/var/log" + ]; + }; }; }