Fixes report-hm-change script

Abhinav Sarkar 2023-12-09 12:14:27 +05:30
parent cf0350ad6d
commit bf4beceaf1
1 changed files with 3 additions and 3 deletions

View File

@ -1,13 +1,13 @@
{ config, pkgs, ... }:
let
profiles = "/nix/var/nix/profiles/per-user/${config.home.username}/home-manager-*-link";
profiles = "/nix/var/nix/profiles/per-user/${config.home.username}/profile-*-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
if [ $(/bin/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)
${pkgs.nvd}/bin/nvd diff $(/bin/ls -d1v ${profiles} | tail -2)
fi
''