You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
658 B
Plaintext
30 lines
658 B
Plaintext
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
|
|
}
|
|
|