Files
alo-cluster/common/cifs-client.nix
2024-09-13 13:38:15 +01:00

35 lines
981 B
Nix

{ pkgs, ... }:
{
environment.systemPackages = [ pkgs.cifs-utils ];
environment.etc."nixos/smb-secrets" = {
text = ''
username=compute
password=aaShecheseiwee5eeh2p
'';
mode = "0400";
};
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" ];
};
}