Extract a docker mixin

This commit is contained in:
Oliver Davies 2025-04-05 09:00:00 +01:00
parent a4cacfd4de
commit 44d2685854
11 changed files with 20 additions and 46 deletions

View file

@ -2,14 +2,12 @@
{
imports = [
../../modules/mixins/docker.nix
../common
../../users/opdavies
];
nixosModules = {
docker.enable = true;
};
wsl = {
enable = true;
defaultUser = username;

View file

@ -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;

View file

@ -9,8 +9,7 @@
./users.nix
../../modules/mixins/bluetooth.nix
./modules/docker.nix
../../modules/mixins/docker.nix
../common
../../users/opdavies

View file

@ -1,3 +0,0 @@
{
virtualisation.docker.enable = true;
}

View file

@ -9,8 +9,6 @@
./services
./users.nix
./modules/docker.nix
../common
../../users/opdavies
];

View file

@ -1,3 +0,0 @@
{
virtualisation.docker.enable = true;
}

12
modules/mixins/docker.nix Normal file
View file

@ -0,0 +1,12 @@
{
virtualisation.docker = {
enable = true;
autoPrune = {
enable = true;
dates = "weekly";
};
};
users.users.opdavies.extraGroups = [ "docker" ];
}

View file

@ -1,5 +0,0 @@
{
imports = [
./docker.nix
];
}

View file

@ -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";
};
};
};
}

View file

@ -1,6 +1,5 @@
{
imports = [
./cli
./desktop
./gaming.nix
./homelab

View file

@ -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