Migrate CIFS to NFS

This commit is contained in:
Andrea Ciceri 2024-10-17 23:23:13 +02:00
parent 494542e1d2
commit 688ec82caf
Signed by: aciceri
SSH key fingerprint: SHA256:/AagBweyV4Hlfg9u092n8hbHwD5fcB6A3qhDiDA65Rg
2 changed files with 39 additions and 13 deletions

View file

@ -4,18 +4,24 @@
...
}:
{
fileSystems."/home/${config.ccr.username}/torrent" = {
device = "//sisko.fleet/torrent";
fsType = "cifs";
options =
let
credentials = pkgs.writeText "credentials" ''
username=guest
password=
'';
in
[
"credentials=${credentials},x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s,uid=1000,gid=1000"
];
environment.systemPackages = with pkgs; [ nfs-utils ];
boot.supportedFilesystems = [ "nfs" ];
services.rpcbind.enable = true;
security.wrappers."mount.nfs" = {
setuid = true;
owner = "root";
group = "root";
source = "${pkgs.nfs-utils.out}/bin/mount.nfs";
};
fileSystems."/home/${config.ccr.username}/nas" = {
device = "sisko.fleet:/hd";
fsType = "nfs";
options = [
"x-systemd.automount"
"noauto"
"user"
];
};
}