diff --git a/hosts/PW05CH3L/configuration.nix b/hosts/PW05CH3L/configuration.nix index 75dd43ea..50258f22 100644 --- a/hosts/PW05CH3L/configuration.nix +++ b/hosts/PW05CH3L/configuration.nix @@ -2,14 +2,12 @@ { imports = [ + ../../modules/mixins/docker.nix + ../common ../../users/opdavies ]; - nixosModules = { - docker.enable = true; - }; - wsl = { enable = true; defaultUser = username; diff --git a/hosts/nixedo/configuration.nix b/hosts/nixedo/configuration.nix index 031f3cf8..d16c24bc 100644 --- a/hosts/nixedo/configuration.nix +++ b/hosts/nixedo/configuration.nix @@ -9,6 +9,9 @@ ./hardware-configuration.nix ./secrets.nix ./services.nix + + ../../modules/mixins/docker.nix + ./modules/acme.nix ../common @@ -17,7 +20,6 @@ nixosModules = { audiobookshelf.enable = true; - docker.enable = true; immich.enable = true; jellyfin.enable = true; paperless.enable = true; diff --git a/hosts/t480/configuration.nix b/hosts/t480/configuration.nix index 8cbc77e8..3c8e8da7 100644 --- a/hosts/t480/configuration.nix +++ b/hosts/t480/configuration.nix @@ -9,8 +9,7 @@ ./users.nix ../../modules/mixins/bluetooth.nix - - ./modules/docker.nix + ../../modules/mixins/docker.nix ../common ../../users/opdavies diff --git a/hosts/t480/modules/docker.nix b/hosts/t480/modules/docker.nix deleted file mode 100644 index a8780150..00000000 --- a/hosts/t480/modules/docker.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - virtualisation.docker.enable = true; -} diff --git a/hosts/t490/configuration.nix b/hosts/t490/configuration.nix index be333157..6259f3aa 100644 --- a/hosts/t490/configuration.nix +++ b/hosts/t490/configuration.nix @@ -9,8 +9,6 @@ ./services ./users.nix - ./modules/docker.nix - ../common ../../users/opdavies ]; diff --git a/hosts/t490/modules/docker.nix b/hosts/t490/modules/docker.nix deleted file mode 100644 index a8780150..00000000 --- a/hosts/t490/modules/docker.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - virtualisation.docker.enable = true; -} diff --git a/modules/mixins/docker.nix b/modules/mixins/docker.nix new file mode 100644 index 00000000..5b976241 --- /dev/null +++ b/modules/mixins/docker.nix @@ -0,0 +1,12 @@ +{ + virtualisation.docker = { + enable = true; + + autoPrune = { + enable = true; + dates = "weekly"; + }; + }; + + users.users.opdavies.extraGroups = [ "docker" ]; +} diff --git a/modules/nixos/cli/default.nix b/modules/nixos/cli/default.nix deleted file mode 100644 index 9045632e..00000000 --- a/modules/nixos/cli/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - imports = [ - ./docker.nix - ]; -} diff --git a/modules/nixos/cli/docker.nix b/modules/nixos/cli/docker.nix deleted file mode 100644 index 66c9ddd4..00000000 --- a/modules/nixos/cli/docker.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ lib, config, ... }: - -with lib; - -{ - options.nixosModules.docker.enable = mkEnableOption "Enable Docker"; - - config = mkIf config.nixosModules.docker.enable { - virtualisation.docker = { - enable = true; - - autoPrune = { - enable = true; - dates = "weekly"; - }; - }; - }; -} diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index 9e5a49cb..f5474c86 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -1,6 +1,5 @@ { imports = [ - ./cli ./desktop ./gaming.nix ./homelab diff --git a/users/opdavies/default.nix b/users/opdavies/default.nix index cb623b02..f94a8ef7 100644 --- a/users/opdavies/default.nix +++ b/users/opdavies/default.nix @@ -1,9 +1,4 @@ -{ - config, - lib, - pkgs, - ... -}: +{ lib, pkgs, ... }: with lib; @@ -16,7 +11,7 @@ with lib; extraGroups = [ "networkmanager" "wheel" - ] ++ optionals config.virtualisation.docker.enable [ "docker" ]; + ]; packages = with pkgs; [ qrencode