From 325a193a3874b67795f4c3ee97abae121f13c286 Mon Sep 17 00:00:00 2001 From: smayzy Date: Fri, 29 Aug 2025 18:53:11 +0200 Subject: [PATCH] add docker --- hosts/desktop1/configuration.nix | 1 + modules/nix/containers/default.nix | 1 + modules/nix/containers/docker.nix | 20 ++++++++++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 modules/nix/containers/docker.nix diff --git a/hosts/desktop1/configuration.nix b/hosts/desktop1/configuration.nix index 1efb311..84b3bab 100644 --- a/hosts/desktop1/configuration.nix +++ b/hosts/desktop1/configuration.nix @@ -19,6 +19,7 @@ virt.enable = true; hyprland.enable = true; kde.enable = true; + docker.enable = true; }; home-manager = { diff --git a/modules/nix/containers/default.nix b/modules/nix/containers/default.nix index 3c22f3c..32562bd 100644 --- a/modules/nix/containers/default.nix +++ b/modules/nix/containers/default.nix @@ -2,5 +2,6 @@ { imports = [ ./nixos + ./docker.nix ]; } diff --git a/modules/nix/containers/docker.nix b/modules/nix/containers/docker.nix new file mode 100644 index 0000000..cd508f3 --- /dev/null +++ b/modules/nix/containers/docker.nix @@ -0,0 +1,20 @@ +{ + lib, + config, + ... +}: +let + inherit (lib) mkIf mkOption types; +in +{ + options.smayzy.docker.enable = mkOption { + type = types.bool; + default = false; + description = "enable docker"; + }; + + config = mkIf config.smayzy.docker.enable { + virtualisation.docker.enable = true; + users.extraGroups.docker.members = [ "smayzy" ]; + }; +}