VEGAS: NFS

This commit is contained in:
Max Headroom 2021-10-16 20:22:40 +02:00
parent f322bee645
commit 6526279a5e
3 changed files with 27 additions and 0 deletions

View file

@ -0,0 +1,12 @@
{ lib, tools, ... }:
{
imports = [ ./exports.nix ];
services.nfs = {
server = {
enable = true;
};
idmapd.settings = {
General.Domain = lib.mkForce tools.meta.domain;
};
};
}

View file

@ -0,0 +1,14 @@
let
entry = { directory, network, security ? "krb5i", writable ? true, options ? [] }:
let
mode = if writable then "rw" else "ro";
optionsFinal = [ mode "sec=${security}" ] ++ options;
concat = builtins.concatStringsSep "," optionsFinal;
in "${directory} ${network}(${concat})";
exports = map entry [
{ directory = "/srv/storage/www/soda"; network = "10.10.2.0/24"; options = [ "no_root_squash" ]; }
];
in {
services.nfs.server.exports = builtins.concatStringsSep "\n" exports;
}

View file

@ -24,6 +24,7 @@
./services/git ./services/git
./services/ipfs ./services/ipfs
./services/jokes ./services/jokes
./services/nfs
] ]
# TODO: fix users # TODO: fix users
# ++ (import ../../users "server").groups.admin # ++ (import ../../users "server").groups.admin