From 181db133933047852dbfd93e0813653e019c359e Mon Sep 17 00:00:00 2001 From: Yorick van Pelt Date: Wed, 18 May 2022 12:28:45 +0200 Subject: [PATCH] flake: add update-home util to work around home manager bug --- flake.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/flake.nix b/flake.nix index a42201f..128bc9a 100644 --- a/flake.nix +++ b/flake.nix @@ -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; + }; }; }