From d39c1fdb49ed0eff97957dcd38b77925b38a7d86 Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Tue, 28 Feb 2023 13:21:51 +0100 Subject: [PATCH] Add lxd module --- modules/lxd/default.nix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 modules/lxd/default.nix 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" ]; + }; +}