def after_apply_all [] { if not ('~/.nix-profile/bin/home-manager' | path exists) { print $"(ansi red)home-manager is not installed(ansi reset)" return } if (ha-chksum) == $env.SILO_HA_CHKSUM? { print $"(ansi green)home-manager configuration unchanged(ansi reset)" return; } print "Updating with home-manager" ( home-manager switch ) print "Expiring old home manager configurations" ( home-manager expire-generations -1 days ) print "Cleaning nix store" ( nix-store --gc ) ignore } def --env before_apply_all [] { $env.SILO_HA_CHKSUM = (ha-chksum) } def ha-chksum [] { shasum ~/.config/home-manager/home.nix }