From ef33e52880325fbd4e5cfc530917ff58bc442bdf Mon Sep 17 00:00:00 2001 From: h7x4 Date: Wed, 21 May 2025 10:03:35 +0200 Subject: [PATCH] common/docker: split file, fix auto-prune service --- hosts/common/default.nix | 8 +------- hosts/common/services/docker.nix | 12 ++++++++++++ 2 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 hosts/common/services/docker.nix diff --git a/hosts/common/default.nix b/hosts/common/default.nix index 133cdcf..3a1a8fb 100644 --- a/hosts/common/default.nix +++ b/hosts/common/default.nix @@ -16,6 +16,7 @@ in { ./services/blueman.nix ./services/dbus.nix ./services/display-manager.nix + ./services/docker.nix ./services/fwupd.nix ./services/irqbalance.nix ./services/journald.nix @@ -278,11 +279,4 @@ in { }; }; }; - - virtualisation.docker.enableOnBoot = lib.mkDefault false; - virtualisation.docker.autoPrune = { - enable = lib.mkDefault true; - flags = [ "--system" "--all" ]; - dates = "daily"; - }; } diff --git a/hosts/common/services/docker.nix b/hosts/common/services/docker.nix new file mode 100644 index 0000000..5305af7 --- /dev/null +++ b/hosts/common/services/docker.nix @@ -0,0 +1,12 @@ +{ config, lib, ... }: +let + cfg = config.virtualisation.docker; +in +{ + virtualisation.docker.enableOnBoot = lib.mkDefault false; + virtualisation.docker.autoPrune = { + enable = lib.mkDefault cfg.enable; + flags = [ "--all" ]; + dates = "daily"; + }; +}