nfsroot: export volumes not shares via nfs
This commit is contained in:
parent
0324645bc9
commit
7fb37eb03c
|
@ -1,6 +1,12 @@
|
|||
{ zentralwerk, config, lib, pkgs, ... }:
|
||||
let
|
||||
netConfig = zentralwerk.lib.config.site.net.serv;
|
||||
|
||||
nfsExports = [
|
||||
"var/lib/nfsroot/dacbert"
|
||||
"var/lib/nfsroot/riscbert"
|
||||
"var/lib/dump-dvb/whoopsie"
|
||||
];
|
||||
in {
|
||||
microvm = {
|
||||
hypervisor = "qemu";
|
||||
|
@ -17,7 +23,13 @@ in {
|
|||
tag = builtins.baseNameOf dir;
|
||||
proto = "virtiofs";
|
||||
socket = "${builtins.baseNameOf dir}.socket";
|
||||
}) [ "etc" "home" "var" "var/lib/nfsroot/dacbert" "var/lib/nfsroot/riscbert" "var/lib/dump-dvb/whoopsie" ];
|
||||
}) [ "etc" "home" "var" ];
|
||||
|
||||
volumes = map (export: {
|
||||
mountPoint = "/${export}";
|
||||
image = "/dev/zvol/${config.networking.hostName}/vm/nfsroot/${builtins.baseNameOf export}";
|
||||
autoCreate = false;
|
||||
}) nfsExports;
|
||||
|
||||
interfaces = [ {
|
||||
type = "tap";
|
||||
|
@ -26,6 +38,10 @@ in {
|
|||
} ];
|
||||
};
|
||||
|
||||
fileSystems = builtins.foldl' (fileSystems: export: fileSystems // {
|
||||
"/${export}".options = [ "relatime" "discard" ];
|
||||
}) {} nfsExports;
|
||||
|
||||
networking = {
|
||||
hostName = "nfsroot";
|
||||
|
||||
|
|
Loading…
Reference in New Issue