From 86b7e0b1ecbd6e4496891f997de7239de32c3dc6 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Thu, 5 Sep 2024 08:53:54 -0400 Subject: [PATCH] fix(docker): add enable option --- devices/servivi/default.nix | 1 + nixosModules/docker/default.nix | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/devices/servivi/default.nix b/devices/servivi/default.nix index 20b862ad..174de5a1 100644 --- a/devices/servivi/default.nix +++ b/devices/servivi/default.nix @@ -69,5 +69,6 @@ in { sshd.enable = true; }; + khepri.enable = true; services.kmscon.enable = true; } diff --git a/nixosModules/docker/default.nix b/nixosModules/docker/default.nix index e96b125b..2d680386 100644 --- a/nixosModules/docker/default.nix +++ b/nixosModules/docker/default.nix @@ -12,6 +12,14 @@ in { imports = [khepri.nixosModules.default]; options.khepri = { + enable = mkOption { + default = cfg.compositions != {}; + type = types.bool; + description = '' + Option to enable docker even without compositions. + ''; + }; + rwDataDir = mkOption { default = "/var/lib/docker"; type = types.str; @@ -26,7 +34,7 @@ in { }; }; - config = mkIf (cfg.compositions != {}) { + config = mkIf (cfg.enable) { users.extraUsers.${mainUser}.extraGroups = ["docker"]; virtualisation = {