From 7c0c94b47a6f325266b941651ad85e1ec8ae3faf Mon Sep 17 00:00:00 2001 From: Leyla Becker Date: Sun, 16 Mar 2025 20:34:09 -0500 Subject: [PATCH] updated nfs config --- .../server/network_storage/default.nix | 22 +++++++++---------- .../server/network_storage/nfs.nix | 15 ++++++++++--- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/modules/nixos-modules/server/network_storage/default.nix b/modules/nixos-modules/server/network_storage/default.nix index f756738..00ea7ac 100644 --- a/modules/nixos-modules/server/network_storage/default.nix +++ b/modules/nixos-modules/server/network_storage/default.nix @@ -15,7 +15,7 @@ in { export_directory = lib.mkOption { type = lib.types.path; description = "what are exports going to be stored in"; - default = "/exports"; + default = "/export"; }; directories = lib.mkOption { type = lib.types.listOf (lib.types.submodule ({config, ...}: { @@ -57,7 +57,7 @@ in { # create any folders that we need to have for our exports systemd.tmpfiles.rules = [ - "d ${config.host.network_storage.export_directory} 2775 root root -" + "d ${config.host.network_storage.export_directory} 2775 nobody nogroup -" ] ++ ( builtins.map ( @@ -77,14 +77,14 @@ in { ) ); } - (lib.mkIf config.host.impermanence.enable { - environment.persistence."/persist/system/root" = { - enable = true; - hideMounts = true; - directories = [ - config.host.network_storage.export_directory - ]; - }; - }) + # (lib.mkIf config.host.impermanence.enable { + # environment.persistence."/persist/system/root" = { + # enable = true; + # hideMounts = true; + # directories = [ + # config.host.network_storage.export_directory + # ]; + # }; + # }) ]); } diff --git a/modules/nixos-modules/server/network_storage/nfs.nix b/modules/nixos-modules/server/network_storage/nfs.nix index 26480d6..bad0452 100644 --- a/modules/nixos-modules/server/network_storage/nfs.nix +++ b/modules/nixos-modules/server/network_storage/nfs.nix @@ -56,11 +56,20 @@ ++ ( lib.lists.imap0 ( i: directory: let - option = fsid: "(rw,fsid=${toString fsid},nohide,insecure,no_subtree_check)"; - addresses = ["100.64.0.0/10" "192.168.0.0/24" "127.0.0.1"]; + createOptions = fsid: "(rw,fsid=${toString fsid},nohide,insecure,no_subtree_check)"; + addresses = [ + # loopback + "127.0.0.1" + "::1" + # local network + # "192.168.0.0/24" + # tailscale + "100.64.0.0/10" + "fd7a:115c:a1e0::/48" + ]; options = lib.strings.concatStrings ( lib.strings.intersperse " " ( - lib.lists.imap0 (index: address: "${address}${option (1 + (i * (builtins.length addresses)) + index)}") addresses + lib.lists.imap0 (index: address: "${address}${createOptions (1 + (i * (builtins.length addresses)) + index)}") addresses ) ); in "${directory._directory} ${options}"