flake: add update-home util to work around home manager bug

auto-flake-update
Yorick van Pelt 2022-05-18 12:28:45 +02:00
parent 25919c1ed9
commit 181db13393
Signed by: yorick
GPG Key ID: A36E70F9DC014A15
1 changed files with 10 additions and 0 deletions

View File

@ -52,6 +52,16 @@
};
packages.x86_64-linux.yorick-home =
self.homeConfigurations.x86_64-linux.activationPackage;
apps.x86_64-linux.update-home = {
type = "app";
program = (self.legacyPackages.x86_64-linux.writeScript "update-home" ''
set -euo pipefail
old_profile=$(nix profile list | grep home-manager-path | head -n1 | awk '{print $4}')
echo $old_profile
nix profile remove $old_profile
${self.packages.x86_64-linux.yorick-home}/activate || (echo "restoring old profile"; ${self.legacyPackages.x86_64-linux.nix}/bin/nix profile install $old_profile)
'').outPath;
};
};
}