diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-10-11 18:01:38 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-10-11 18:01:38 +0200 |
commit | acda6315ad06c2597a8747e45a577da2c4216735 (patch) | |
tree | 7dda432e19c6c4ecadcc914f5b28ad953b4f06b7 /modules/system/services/system_diff/default.nix | |
parent | build(treewide): Update (diff) | |
download | nixos-config-acda6315ad06c2597a8747e45a577da2c4216735.tar.gz nixos-config-acda6315ad06c2597a8747e45a577da2c4216735.zip |
feat(services/diffSystem): Init
Diffstat (limited to 'modules/system/services/system_diff/default.nix')
-rw-r--r-- | modules/system/services/system_diff/default.nix | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/modules/system/services/system_diff/default.nix b/modules/system/services/system_diff/default.nix new file mode 100644 index 00000000..052ffae2 --- /dev/null +++ b/modules/system/services/system_diff/default.nix @@ -0,0 +1,26 @@ +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.soispha.services.systemDiff; +in { + options.soispha.services.systemDiff = { + enable = lib.mkEnableOption "nvd run at system activation"; + }; + + config = lib.mkIf cfg.enable { + system.activationScripts.diff = { + supportsDryActivation = true; + text = '' + PATH="${lib.makeBinPath [pkgs.nvd config.nix.package]}:$PATH" + + if [ -e /run/current-system ]; then + # ${lib.getExe config.nix.package} --extra-experimental-features nix-command store diff-closures /run/current-system "$systemConfig" + nvd diff $(ls -dv /nix/var/nix/profiles/system-*-link | tail -2) + fi + ''; + }; + }; +} |