nixos-config/modules/libvirtd/default.nix

32 lines
599 B
Nix
Raw Normal View History

{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.eboskma.libvirtd;
in
{
options.eboskma.libvirtd = { enable = mkEnableOption "libvirtd"; };
config = mkIf (cfg.enable) {
virtualisation.libvirtd = {
enable = true;
};
networking = {
interfaces = {
br0 = {
useDHCP = true;
macAddress = "04:d9:f5:f9:c2:c6";
};
};
bridges = {
"br0" = {
interfaces = [ "enp4s0" ];
# rstp = true;
};
};
};
users.users.${config.eboskma.var.mainUser}.extraGroups = [ "libvirtd" ];
};
}