From c86401084371c424d0134c58a22e6764e8c2cdbb Mon Sep 17 00:00:00 2001 From: Dmitriy Kholkin Date: Sat, 28 Dec 2024 11:37:41 +0300 Subject: [PATCH] auto mount nfs share --- machines/AMD-Workstation/default.nix | 5 +++++ machines/Dell-Laptop/default.nix | 6 ++++++ machines/Home-Hypervisor/boot.nix | 3 ++- machines/Home-Hypervisor/default.nix | 7 +++++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/machines/AMD-Workstation/default.nix b/machines/AMD-Workstation/default.nix index 152ba85..a99f41a 100644 --- a/machines/AMD-Workstation/default.nix +++ b/machines/AMD-Workstation/default.nix @@ -90,6 +90,11 @@ "gid=${toString config.users.groups.users.gid}" ]; }; + "/media/local-nfs" = { + device = "10.10.10.11:/"; + fsType = "nfs4"; + options = [ "nfsvers=4.2" "x-systemd.automount" "noauto" ]; + }; }; powerManagement.cpuFreqGovernor = "schedutil"; diff --git a/machines/Dell-Laptop/default.nix b/machines/Dell-Laptop/default.nix index 4f0dc62..ca668c1 100644 --- a/machines/Dell-Laptop/default.nix +++ b/machines/Dell-Laptop/default.nix @@ -40,6 +40,12 @@ boot.kernelParams = [ "mem_sleep_default=deep" ]; + fileSystems."/media/local-nfs" = { + device = "10.10.10.11:/"; + fsType = "nfs4"; + options = [ "nfsvers=4.2" "x-systemd.automount" "noauto" ]; + }; + persist.state.homeDirectories = [ ".config/Moonlight Game Streaming Project" ]; home-manager.users.${config.mainuser} = { home.packages = [ diff --git a/machines/Home-Hypervisor/boot.nix b/machines/Home-Hypervisor/boot.nix index 8138966..3614a51 100644 --- a/machines/Home-Hypervisor/boot.nix +++ b/machines/Home-Hypervisor/boot.nix @@ -52,7 +52,7 @@ in { useOSProber = false; }; }; - kernelModules = [ "tcp_bbr" "veth" ]; + kernelModules = [ "tcp_bbr" "veth" "nfsv4" ]; kernelParams = [ "zfs.zfs_arc_max=${zfs_arc_max}" "zswap.enabled=0" @@ -76,6 +76,7 @@ in { "vm.overcommit_memory" = lib.mkForce 1; }; + supportedFilesystems = [ "nfs4" ]; zfs.extraPools = [ "bpool" "rpool" "nas-pool" ]; }; diff --git a/machines/Home-Hypervisor/default.nix b/machines/Home-Hypervisor/default.nix index d230c5b..517ebdc 100644 --- a/machines/Home-Hypervisor/default.nix +++ b/machines/Home-Hypervisor/default.nix @@ -99,6 +99,12 @@ in { }; }; + fileSystems."/media/local-nfs" = { + device = "10.10.10.11:/"; + fsType = "nfs4"; + options = [ "nfsvers=4.2" "x-systemd.automount" "noauto" ]; + }; + environment.memoryAllocator.provider = "libc"; services.udisks2.enable = false; fonts.enableDefaultPackages = false; @@ -126,6 +132,7 @@ in { "recursive-nix" ]; + environment.systemPackages = with pkgs; [ nfs-utils ]; home-manager.users.${config.mainuser} = { home.file.".config/libvirt/libvirt.conf".text = '' uri_default = "qemu:///system"