VEGAS: NFS
This commit is contained in:
parent
f322bee645
commit
6526279a5e
3 changed files with 27 additions and 0 deletions
12
hosts/VEGAS/services/nfs/default.nix
Normal file
12
hosts/VEGAS/services/nfs/default.nix
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{ lib, tools, ... }:
|
||||||
|
{
|
||||||
|
imports = [ ./exports.nix ];
|
||||||
|
services.nfs = {
|
||||||
|
server = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
idmapd.settings = {
|
||||||
|
General.Domain = lib.mkForce tools.meta.domain;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
14
hosts/VEGAS/services/nfs/exports.nix
Normal file
14
hosts/VEGAS/services/nfs/exports.nix
Normal 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;
|
||||||
|
}
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue