From a261fbe165d16f5f85604513acc79316d59f1a51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Mon, 16 Oct 2023 16:57:35 +0200 Subject: [PATCH] Move diff-closures to nixos-modules --- flake.lock | 6 +++--- modules/autoupdate.nix | 23 ++++++++--------------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/flake.lock b/flake.lock index dff0cfec..000309d7 100644 --- a/flake.lock +++ b/flake.lock @@ -398,11 +398,11 @@ ] }, "locked": { - "lastModified": 1695942940, - "narHash": "sha256-uTDcudSWYvtXy+qZODSWhyMtbyky2hhX84HtGxfjw/o=", + "lastModified": 1697468218, + "narHash": "sha256-cv4Ijohh4SP5zELBxjNEwGdA3UV+B3POvH0YVkOpAZs=", "owner": "SuperSandro2000", "repo": "nixos-modules", - "rev": "085931181b27b32d841965e0e31516556e7a2e88", + "rev": "4880c21851651b14d091894fb94e9173b58fbf15", "type": "github" }, "original": { diff --git a/modules/autoupdate.nix b/modules/autoupdate.nix index a9e8d33d..a8b66e88 100644 --- a/modules/autoupdate.nix +++ b/modules/autoupdate.nix @@ -57,21 +57,14 @@ startAt = "hourly"; }; - nix.gc = lib.mkIf config.c3d2.autoUpdate { - automatic = true; - randomizedDelaySec = "6h"; - options = "--delete-older-than 21d"; - }; - - # Show a diff when activating a new system except for microvms which handle this seperately - system.activationScripts.diff-system = lib.mkIf (config.c3d2.deployment.server == "") { - supportsDryActivation = true; - text = '' - if [ -e /run/current-system ] && [ -e $systemConfig ]; then - echo System package diff: - ${config.nix.package}/bin/nix --extra-experimental-features nix-command store diff-closures /run/current-system $systemConfig || true - fi - ''; + nix = { + # Show a diff when activating a new system except for microvms which handle this seperately + diffSystem = config.c3d2.deployment.server == ""; + gc = lib.mkIf config.c3d2.autoUpdate { + automatic = true; + randomizedDelaySec = "6h"; + options = "--delete-older-than 21d"; + }; }; environment.systemPackages = [ (