From ddc4d8cea0847a6e73f4b8d18adb3442630491a7 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sun, 3 Dec 2023 04:18:09 +0100 Subject: [PATCH] set up homearea automounts --- hosts/bekkalokk/configuration.nix | 1 + hosts/bicep/configuration.nix | 1 + hosts/buskerud/configuration.nix | 1 + hosts/ildkule/configuration.nix | 1 + hosts/shark/configuration.nix | 1 + modules/home-areas.nix | 27 +++++++++++++++++++++++++++ 6 files changed, 32 insertions(+) create mode 100644 modules/home-areas.nix diff --git a/hosts/bekkalokk/configuration.nix b/hosts/bekkalokk/configuration.nix index 358c43e..72cd8bd 100644 --- a/hosts/bekkalokk/configuration.nix +++ b/hosts/bekkalokk/configuration.nix @@ -5,6 +5,7 @@ ../../base.nix ../../misc/metrics-exporters.nix + ../../modules/home-areas.nix #./services/keycloak.nix diff --git a/hosts/bicep/configuration.nix b/hosts/bicep/configuration.nix index 2350492..0f1be8a 100644 --- a/hosts/bicep/configuration.nix +++ b/hosts/bicep/configuration.nix @@ -5,6 +5,7 @@ ../../base.nix ../../misc/metrics-exporters.nix + ../../modules/home-areas.nix ./services/nginx ./acmeCert.nix diff --git a/hosts/buskerud/configuration.nix b/hosts/buskerud/configuration.nix index 0c0ffb0..2653000 100644 --- a/hosts/buskerud/configuration.nix +++ b/hosts/buskerud/configuration.nix @@ -5,6 +5,7 @@ ./hardware-configuration.nix ../../base.nix ../../misc/metrics-exporters.nix + ../../modules/home-areas.nix ./services/openvpn-client.nix ]; diff --git a/hosts/ildkule/configuration.nix b/hosts/ildkule/configuration.nix index 3da4a33..0052588 100644 --- a/hosts/ildkule/configuration.nix +++ b/hosts/ildkule/configuration.nix @@ -5,6 +5,7 @@ ./hardware-configuration.nix ../../base.nix ../../misc/metrics-exporters.nix + ../../modules/home-areas.nix ./services/nginx ./services/metrics diff --git a/hosts/shark/configuration.nix b/hosts/shark/configuration.nix index d22263c..dd2199e 100644 --- a/hosts/shark/configuration.nix +++ b/hosts/shark/configuration.nix @@ -5,6 +5,7 @@ ./hardware-configuration.nix ../../base.nix ../../misc/metrics-exporters.nix + ../../modules/home-areas.nix ]; sops.defaultSopsFile = ../../secrets/shark/shark.yaml; diff --git a/modules/home-areas.nix b/modules/home-areas.nix new file mode 100644 index 0000000..f3885fa --- /dev/null +++ b/modules/home-areas.nix @@ -0,0 +1,27 @@ +{ pkgs, lib, ... }: +{ + fileSystems = let + shorthandAreas = { + # See toriel:/etc/exports + "/home/pvv/t/pederbs" = "homepvvt.pvv.ntnu.no:/export/home/pvv/t/pederbs"; + "/home/pvv/t/yorinad" = "homepvvt.pvv.ntnu.no:/export/home/pvv/t/yorinad"; + } + // + # See microbel:/etc/exports + (lib.listToAttrs (map + (l: lib.nameValuePair "/home/pvv/${l}" "homepvv${l}.pvv.ntnu.no:/export/home/pvv/${l}") + [ "a" "b" "c" "d" "h" "i" "j" "k" "l" "m" "z" ])); + in { } + // + (lib.mapAttrs (_: device: { + inherit device; + fsType = "nfs"; + options = [ + "nfsvers=3" + "noauto" + "proto=tcp" + "x-systemd.automount" + "x-systemd.idle-timeout=300" + ]; + }) shorthandAreas); +}