From d5b23c1e586d21f9130bb5d8cebce093566106f3 Mon Sep 17 00:00:00 2001 From: James Coleman Date: Mon, 12 Aug 2024 19:24:57 -0500 Subject: [PATCH] Add merged automount. --- README.md | 1 + modules/nixos/mnt-merged.nix | 21 +++++++++++++++++++++ profiles/desktop.nix | 1 + 3 files changed, 23 insertions(+) create mode 100644 modules/nixos/mnt-merged.nix diff --git a/README.md b/README.md index af117d0..44bb3e6 100644 --- a/README.md +++ b/README.md @@ -40,4 +40,5 @@ After install is complete, you can then rsync the nixos dir to the user account nix-shell -p rsync mount -o compress=zstd /dev/mapper/crypted /mnt/hdd rsync -av /root/nixos/ /mnt/hdd/home/grmrgecko/nixos/ +umount /mnt/hdd ``` diff --git a/modules/nixos/mnt-merged.nix b/modules/nixos/mnt-merged.nix new file mode 100644 index 0000000..a3155c8 --- /dev/null +++ b/modules/nixos/mnt-merged.nix @@ -0,0 +1,21 @@ +{ config, lib, pkgs, settings, ... }: + +{ + services.rpcbind.enable = true; # needed for NFS + systemd.mounts = [{ + type = "nfs"; + mountConfig = { + Options = "noatime"; + }; + what = "10.0.0.5:/mnt/merged"; + where = "/mnt/merged"; + }]; + + systemd.automounts = [{ + wantedBy = [ "multi-user.target" ]; + automountConfig = { + TimeoutIdleSec = "600"; + }; + where = "/mnt/merged"; + }]; +} diff --git a/profiles/desktop.nix b/profiles/desktop.nix index c657005..354a5da 100644 --- a/profiles/desktop.nix +++ b/profiles/desktop.nix @@ -9,5 +9,6 @@ ../modules/nixos/management.nix ../modules/nixos/desktop.nix ../modules/nixos/docker.nix + ../modules/nixos/mnt-merged.nix ]; }