1
0
Fork 0

Nspawn containers use host network for now.

This commit is contained in:
Kevin Baensch 2021-10-28 15:18:03 +02:00
parent 29b64aadfd
commit 4305b3f653
Signed by: derped
GPG Key ID: C0F1D326C7626543
1 changed files with 28 additions and 0 deletions

28
services/nspawn.nix Normal file
View File

@ -0,0 +1,28 @@
{ config, lib, ... }:
with lib;
mkIf (elem "nspawn" config.machine.services) {
systemd = let
fn = import ../fn.nix { inherit lib; };
in {
nspawn = recursiveUpdate (listToAttrs (
(map (
name: {
name = name;
value = { networkConfig.VirtualEthernet = "no"; };
}
)
(fn.lst { p = /var/lib/machines; t = "directory"; b = false; })
))) {
"64Arch" = {
filesConfig = {
"BindReadOnly" = ["/tmp/.X11-unix"];
"Bind" = ["/dev/snd" "/dev/dri"];
# TODO: Add this to service overrides
# "DeviceAllow" = [ "/dev/dri/renderD128" ];
};
};
};
};
}