Adds report-hm-changes script
parent
9976991058
commit
a2d2812bd2
@ -0,0 +1,7 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
rc = pkgs.callPackage ./report-hm-changes.nix { inherit config pkgs; };
|
||||
in {
|
||||
home.packages = [ rc ];
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
let
|
||||
profiles = "/nix/var/nix/profiles/per-user/${config.home.username}/home-manager-*-link";
|
||||
in
|
||||
pkgs.writeShellScriptBin "report-hm-changes" ''
|
||||
# Disable nvd if there are less than 2 hm profiles.
|
||||
if [ $(ls -d1v ${profiles} 2>/dev/null | wc -l) -lt 2 ]; then
|
||||
echo "Skipping changes report..."
|
||||
else
|
||||
${pkgs.nvd}/bin/nvd diff $(ls -d1v ${profiles} | tail -2)
|
||||
fi
|
||||
''
|
Loading…
Reference in New Issue