depot/hosts/VEGAS/services/nfs/exports.nix

15 lines
509 B
Nix
Raw Normal View History

2021-10-16 21:22:40 +03:00
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;
}