Improve home manager update script

main
jri 9 months ago
parent 0df634c254
commit f07817e065

@ -33,8 +33,10 @@
# nodejs packages # nodejs packages
nodejs nodejs
yarn
biome biome
nodePackages.typescript-language-server nodePackages.typescript-language-server
nodePackages.get-graphql-schema
# java packages # java packages
jdk jdk

@ -15,3 +15,4 @@ alias `shx` = sudo -E helix -c '{{dirs.config}}/helix/config.toml'
{{#if-installed nix}} {{#if-installed nix}}
alias devshell = nix develop -c $env.SHELL alias devshell = nix develop -c $env.SHELL
{{/if-installed}} {{/if-installed}}
def `silo cd` [] { silo repo | cd $in }

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

Loading…
Cancel
Save