Fixes reporting package changes
parent
57621c0558
commit
440404efb4
20
justfile
20
justfile
|
@ -28,9 +28,9 @@ _switch: _build
|
||||||
./result/sw/bin/darwin-rebuild -v switch --flake "{{ root_dir }}"
|
./result/sw/bin/darwin-rebuild -v switch --flake "{{ root_dir }}"
|
||||||
|
|
||||||
# switch to latest home-manager generation
|
# switch to latest home-manager generation
|
||||||
switch: (_run "_switch")
|
switch: (_run "_switch") && _report-changes
|
||||||
|
|
||||||
_update: && _switch _brew-update
|
_update: && _switch _brew-update _report-changes
|
||||||
nix flake update --commit-lock-file "{{ root_dir }}"
|
nix flake update --commit-lock-file "{{ root_dir }}"
|
||||||
$NIXPKGS_PATH/pkgs/applications/editors/vscode/extensions/update_installed_exts.sh > \
|
$NIXPKGS_PATH/pkgs/applications/editors/vscode/extensions/update_installed_exts.sh > \
|
||||||
{{ root_dir }}/programs/vscode/extensions.nix
|
{{ root_dir }}/programs/vscode/extensions.nix
|
||||||
|
@ -40,11 +40,19 @@ _brew-update:
|
||||||
brew upgrade
|
brew upgrade
|
||||||
mas upgrade
|
mas upgrade
|
||||||
|
|
||||||
|
_report-changes:
|
||||||
|
#!/bin/bash
|
||||||
|
if [ $(ls -d1v /nix/var/nix/profiles/system-*-link 2>/dev/null | wc -l) -lt 2 ]; then
|
||||||
|
echo "Skipping changes report..."
|
||||||
|
else
|
||||||
|
nvd diff $(/bin/ls -d1v /nix/var/nix/profiles/system-*-link | tail -2)
|
||||||
|
fi
|
||||||
|
|
||||||
# update packages and switch
|
# update packages and switch
|
||||||
update: (_run "_update")
|
update: (_run "_update")
|
||||||
|
|
||||||
# clean up nix garbage
|
# clean up nix garbage
|
||||||
clean:
|
clean days="7":
|
||||||
home-manager expire-generations "-7 days"
|
home-manager expire-generations "-{{days}} days"
|
||||||
sudo nix-collect-garbage -d --delete-older-than 7d
|
sudo nix-collect-garbage -d --delete-older-than {{days}}d
|
||||||
brew cleanup --prune 7
|
brew cleanup --prune {{days}}
|
||||||
|
|
|
@ -8,6 +8,7 @@ let
|
||||||
nix-diff
|
nix-diff
|
||||||
nix-tree
|
nix-tree
|
||||||
nixfmt
|
nixfmt
|
||||||
|
nvd
|
||||||
rnix-lsp
|
rnix-lsp
|
||||||
statix
|
statix
|
||||||
cachix
|
cachix
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let rc = pkgs.callPackage ./report-hm-changes.nix { inherit config pkgs; };
|
{ home.packages = []; }
|
||||||
in { home.packages = [ rc ]; }
|
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
let 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 [ $(/bin/ls -d1v ${profiles} 2>/dev/null | wc -l) -lt 2 ]; then
|
|
||||||
echo "Skipping changes report..."
|
|
||||||
else
|
|
||||||
${pkgs.nvd}/bin/nvd diff $(/bin/ls -d1v ${profiles} | tail -2)
|
|
||||||
fi
|
|
||||||
''
|
|
Loading…
Reference in New Issue