Compare commits

...

2 Commits

Author SHA1 Message Date
Abhinav Sarkar 1cb27eb1ac flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/b2399a81902a5fa37f691a289fb2c33c1d64036c' (2022-10-25)
  → 'github:nixos/nixpkgs/eb354ebf03d3819d00922d5069cfc63159083a84' (2022-10-26)
2022-10-27 11:34:30 +05:30
Abhinav Sarkar a2d2812bd2 Adds report-hm-changes script 2022-10-27 11:31:08 +05:30
6 changed files with 29 additions and 8 deletions

View File

@ -87,11 +87,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1666722780,
"narHash": "sha256-UpGlFoJMbik+XItmPwoWFrQqOilMIclPrc7Iedt1YaM=",
"lastModified": 1666813329,
"narHash": "sha256-qe1tl0whKf8SW1Kza1KzvkovUV5ZbLv6kDDteYKeIL4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "b2399a81902a5fa37f691a289fb2c33c1d64036c",
"rev": "eb354ebf03d3819d00922d5069cfc63159083a84",
"type": "github"
},
"original": {

View File

@ -1,7 +1,7 @@
{ config, pkgs, ... }:
{
imports = [ ./programs ./launchd.nix ./nix.nix ];
imports = [ ./programs ./scripts ./launchd.nix ./nix.nix ];
home.username = "abhinav";
home.homeDirectory = "/Users/abhinav";

View File

@ -25,6 +25,7 @@ build: (_run "_build")
_switch:
home-manager -v switch --flake "{{ root_dir }}#abhinav"
report-hm-changes
# switch to latest home-manager generation
switch: (_run "_switch")

View File

@ -104,8 +104,8 @@
{
name = "rust-analyzer";
publisher = "rust-lang";
version = "0.4.1260";
sha256 = "0cv1hk14h5yw7zr0b60x5qsy622fd8fbgjarbkjr9sjw5bq2mj22";
version = "0.4.1261";
sha256 = "0z9jkwya41g94b6v1z3ajyqc138q30xsyhhvw1774cwmdi63alwa";
}
{
name = "just";
@ -122,8 +122,8 @@
{
name = "shellcheck";
publisher = "timonwong";
version = "0.26.1";
sha256 = "1jbc08vwi7c8dz9rd09p01zy894i1xv7hmq6anbz1chpqbm1h62a";
version = "0.26.2";
sha256 = "1rwa5abai84vabaz34nfxrvyix8rwxnjys5v2mcy087nzj5i5crq";
}
{
name = "sort-lines";

7
scripts/default.nix Normal file
View File

@ -0,0 +1,7 @@
{ config, lib, pkgs, ... }:
let
rc = pkgs.callPackage ./report-hm-changes.nix { inherit config pkgs; };
in {
home.packages = [ rc ];
}

View File

@ -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
''