Migrate CIFS to NFS
This commit is contained in:
parent
494542e1d2
commit
688ec82caf
2 changed files with 39 additions and 13 deletions
|
@ -4,18 +4,24 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
fileSystems."/home/${config.ccr.username}/torrent" = {
|
environment.systemPackages = with pkgs; [ nfs-utils ];
|
||||||
device = "//sisko.fleet/torrent";
|
boot.supportedFilesystems = [ "nfs" ];
|
||||||
fsType = "cifs";
|
services.rpcbind.enable = true;
|
||||||
options =
|
|
||||||
let
|
security.wrappers."mount.nfs" = {
|
||||||
credentials = pkgs.writeText "credentials" ''
|
setuid = true;
|
||||||
username=guest
|
owner = "root";
|
||||||
password=
|
group = "root";
|
||||||
'';
|
source = "${pkgs.nfs-utils.out}/bin/mount.nfs";
|
||||||
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"
|
fileSystems."/home/${config.ccr.username}/nas" = {
|
||||||
];
|
device = "sisko.fleet:/hd";
|
||||||
|
fsType = "nfs";
|
||||||
|
options = [
|
||||||
|
"x-systemd.automount"
|
||||||
|
"noauto"
|
||||||
|
"user"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
20
modules/sisko-nfs/default.nix
Normal file
20
modules/sisko-nfs/default.nix
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"d /export 770 nobody nogroup"
|
||||||
|
];
|
||||||
|
|
||||||
|
fileSystems."/export/hd" = {
|
||||||
|
device = "/mnt/hd";
|
||||||
|
options = [ "bind" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nfs.server = {
|
||||||
|
enable = true;
|
||||||
|
exports = ''
|
||||||
|
/export 10.100.0.1/24(rw,fsid=0,no_subtree_check)
|
||||||
|
/export/hd 10.100.0.1/24(rw,nohide,insecure,no_subtree_check,no_root_squash)
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.firewall.allowedTCPPorts = [ 2049 ];
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue