Add lxd module

This commit is contained in:
Erwin Boskma 2023-02-28 13:21:51 +01:00
parent 434498fdc1
commit d39c1fdb49
Signed by: erwin
SSH key fingerprint: SHA256:CyeNoWXd3kjX2Nwu6pDxxdS7OqmPVOy0NavA/KU/ntU

23
modules/lxd/default.nix Normal file
View file

@ -0,0 +1,23 @@
{ config, lib, ... }:
with lib;
let
cfg = config.eboskma.lxd;
vars = config.eboskma.var;
in
{
options.eboskma.lxd = { enable = mkEnableOption "lxd"; };
config = mkIf cfg.enable {
virtualisation.lxd = {
enable = true;
recommendedSysctlSettings = true;
};
virtualisation.lxc = {
enable = true;
lxcfs.enable = true;
};
users.users.${vars.mainUser}.extraGroups = [ "lxd" ];
};
}