From 606e41d3ee7d2317d23b693e5e754edb8006494e Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Sun, 8 Sep 2024 15:57:30 +0200 Subject: [PATCH] add docker module, add common modules to hsots/common --- hosts/common/default.nix | 5 +++++ hosts/solaire/default.nix | 3 --- hosts/vamos/default.nix | 2 -- modules/default.nix | 1 + modules/docker.nix | 17 +++++++++++++++++ 5 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 modules/docker.nix diff --git a/hosts/common/default.nix b/hosts/common/default.nix index 1879aba..96f836a 100644 --- a/hosts/common/default.nix +++ b/hosts/common/default.nix @@ -5,4 +5,9 @@ _: ./syncthing ./sops.nix ]; + + modules.gnome.enable = true; + modules.stylix.enable = true; + modules.docker.enable = true; + modules.pipewire.enable = true; } diff --git a/hosts/solaire/default.nix b/hosts/solaire/default.nix index f6ef2f3..56b6216 100644 --- a/hosts/solaire/default.nix +++ b/hosts/solaire/default.nix @@ -33,11 +33,8 @@ ]; }; - modules.gnome.enable = true; - modules.stylix.enable = true; modules.nvidia.enable = true; modules.gaming.enable = true; - modules.pipewire.enable = true; stylix.image = ../../wallpapers/lucy-edgerunners-wallpaper.jpg; } diff --git a/hosts/vamos/default.nix b/hosts/vamos/default.nix index 7ea1f5a..91cdd77 100644 --- a/hosts/vamos/default.nix +++ b/hosts/vamos/default.nix @@ -22,7 +22,5 @@ }; }; }; - modules.gnome.enable = true; - modules.stylix.enable = true; } diff --git a/modules/default.nix b/modules/default.nix index 4ef3485..dcf66f6 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,6 +1,7 @@ _: { imports = [ + ./docker.nix ./pipewire.nix ./nvidia.nix ./gnome.nix diff --git a/modules/docker.nix b/modules/docker.nix new file mode 100644 index 0000000..31ae164 --- /dev/null +++ b/modules/docker.nix @@ -0,0 +1,17 @@ +{ config, lib, ... }: +let + cfg = config.modules.docker; +in + { + options.modules.docker.enable = lib.mkEnableOption "docker module"; + config = lib.mkIf cfg.enable { + virtualisation.docker = { + enable = true; + rootless = { + enable = true; + setSocketVariable = true; + }; + }; + users.users.nezia.extraGroups = [ "docker" ]; + }; +}