From 8c9bd9a0a68fa91b04af678c094ffe960e93fa27 Mon Sep 17 00:00:00 2001 From: Petru Paler Date: Wed, 1 Nov 2023 08:34:35 +0000 Subject: [PATCH] Mount fractal CIFS shares on the compute nodes. --- hosts/common/cifs-client.nix | 39 +++++++++++++++++++++++++++++++++++ hosts/common/compute-node.nix | 1 + 2 files changed, 40 insertions(+) create mode 100644 hosts/common/cifs-client.nix diff --git a/hosts/common/cifs-client.nix b/hosts/common/cifs-client.nix new file mode 100644 index 0000000..9b91901 --- /dev/null +++ b/hosts/common/cifs-client.nix @@ -0,0 +1,39 @@ +{ pkgs, ... }: +{ + environment.systemPackages = [ pkgs.cifs-utils ]; + + environment.etc."nixos/smb-secrets" = { + text = '' + username=compute + password=aaShecheseiwee5eeh2p + ''; + mode = "0400"; + }; + + fileSystems."/data/torrent" = { + device = "//fractal/torrent"; + fsType = "cifs"; + options = let + # this line prevents hanging on network split + automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"; + in ["${automount_opts},credentials=/etc/nixos/smb-secrets"]; + }; + + fileSystems."/data/media" = { + device = "//fractal/media"; + fsType = "cifs"; + options = let + # this line prevents hanging on network split + automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"; + in ["${automount_opts},credentials=/etc/nixos/smb-secrets"]; + }; + + fileSystems."/data/shared" = { + device = "//fractal/shared"; + fsType = "cifs"; + options = let + # this line prevents hanging on network split + automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"; + in ["${automount_opts},credentials=/etc/nixos/smb-secrets"]; + }; +} diff --git a/hosts/common/compute-node.nix b/hosts/common/compute-node.nix index 62d003b..60924f1 100644 --- a/hosts/common/compute-node.nix +++ b/hosts/common/compute-node.nix @@ -1,6 +1,7 @@ { pkgs, ... }: { imports = [ + ./cifs-client.nix ./consul.nix ./glusterfs.nix ./glusterfs-client.nix