From e2eb62df7d32b9a0077b857b5b6de26076ce3e80 Mon Sep 17 00:00:00 2001 From: RatCornu Date: Sun, 3 Aug 2025 14:10:12 +0200 Subject: [PATCH] Ajout options montages NFS --- hosts/vm/apprentix/default.nix | 2 +- hosts/vm/peertube/default.nix | 4 +++ modules/crans/default.nix | 6 ++-- modules/crans/home.nix | 25 --------------- modules/crans/nfs.nix | 57 ++++++++++++++++++++++++++++++++++ 5 files changed, 66 insertions(+), 28 deletions(-) delete mode 100644 modules/crans/home.nix create mode 100644 modules/crans/nfs.nix diff --git a/hosts/vm/apprentix/default.nix b/hosts/vm/apprentix/default.nix index 81e5c14..388970a 100644 --- a/hosts/vm/apprentix/default.nix +++ b/hosts/vm/apprentix/default.nix @@ -19,7 +19,7 @@ resticClient.when = "01:23"; - homeNounou.enable = false; + nfs.homeNounou.enable = false; users.root.passwordFile = ../../../secrets/apprentix/root.age; }; diff --git a/hosts/vm/peertube/default.nix b/hosts/vm/peertube/default.nix index 8dc4753..c4503ee 100644 --- a/hosts/vm/peertube/default.nix +++ b/hosts/vm/peertube/default.nix @@ -23,6 +23,10 @@ }; }; + nfs = { + video.enable = true; + }; + resticClient.when = "05:32"; }; diff --git a/modules/crans/default.nix b/modules/crans/default.nix index cac4a63..1e540f6 100644 --- a/modules/crans/default.nix +++ b/modules/crans/default.nix @@ -8,9 +8,9 @@ in { imports = [ ./age.nix - ./home.nix ./locale.nix ./networking.nix + ./nfs.nix ./ntp.nix ./restic_client.nix ./monitoring.nix @@ -27,7 +27,9 @@ in config = mkIf cfg.enable { crans = { - homeNounou.enable = lib.mkDefault true; + nfs = { + homeNounou.enable = lib.mkDefault true; + }; monitoring.enable = true; networking = { enable = true; diff --git a/modules/crans/home.nix b/modules/crans/home.nix deleted file mode 100644 index e95fbed..0000000 --- a/modules/crans/home.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ lib, config, ... }: - -let - cfg = config.crans.homeNounou; - - inherit (lib) mkEnableOption mkIf; -in - -{ - options.crans.homeNounou = { - enable = mkEnableOption "Monter /home_nounou."; - }; - - config = mkIf cfg.enable { - fileSystems.home_nounou = { - mountPoint = "/home_nounou"; - device = "172.16.10.1:/pool/home"; - fsType = "nfs"; - options = [ - "rw" - "nosuid" - ]; - }; - }; -} diff --git a/modules/crans/nfs.nix b/modules/crans/nfs.nix new file mode 100644 index 0000000..43b4a10 --- /dev/null +++ b/modules/crans/nfs.nix @@ -0,0 +1,57 @@ +{ lib, config, ... }: + +let + cfg = config.crans.nfs; + + inherit (lib) mkEnableOption mkIf; +in + +{ + options.crans.nfs = { + homeAdh.enable = mkEnableOption "Monter /pool/home depuis cameron."; + homeNounou.enable = mkEnableOption "Monter /home_nounou depuis tealc."; + mail.enable = mkEnableOption "Monter /pool/mail depuis cameron."; + video.enable = mkEnableOption "Monter /pool/video depuis cameron."; + }; + + config = { + fileSystems = { + home-adh = mkIf cfg.homeAdh.enable { + mountPoint = "/home-adh"; + device = "172.16.4.2:/pool/home"; + fsType = "nfs"; + options = [ + "rw" + "nosuid" + ]; + }; + home_nounou = mkIf cfg.homeNounou.enable { + mountPoint = "/home_nounou"; + device = "172.16.10.1:/pool/home"; + fsType = "nfs"; + options = [ + "rw" + "nosuid" + ]; + }; + mail = mkIf cfg.mail.enable { + mountPoint = "/mail"; + device = "172.16.4.2:/pool/mail"; + fsType = "nfs"; + options = [ + "rw" + "nosuid" + ]; + }; + video = mkIf cfg.video.enable { + mountPoint = "/video"; + device = "172.16.4.2:/pool/video"; + fsType = "nfs"; + options = [ + "rw" + "nosuid" + ]; + }; + }; + }; +}