diff --git a/modules/lxd/default.nix b/modules/lxd/default.nix new file mode 100644 index 0000000..8ee900c --- /dev/null +++ b/modules/lxd/default.nix @@ -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" ]; + }; +}