From f2c3cb82ada9ff902bd2ccea7b3b60664a1b7ae6 Mon Sep 17 00:00:00 2001 From: ibbem Date: Tue, 27 Jan 2026 21:57:11 +0100 Subject: [PATCH] pass-git-helper,python3Packages.{hystack-ai,molecule}: Use a hook for the temporary home directory The content of `env.HOME` is a string taken as verbatim value for the home directory name. In particular, `env.HOME` isn't evaluated by bash. Hence, `pass-git-helper`, `haystack-ai` and `molecule` created unintended directories which ended up in the derivation. Now, they use a temporary directory which doesn't end up in the derivation. Note that haystack-ai is currently broken. Hence, I don't know if setting `HOME` is actually necessary. In any case, it's misleading. --- pkgs/by-name/pa/pass-git-helper/package.nix | 3 ++- pkgs/development/python-modules/haystack-ai/default.nix | 4 ++-- pkgs/development/python-modules/molecule/default.nix | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/pa/pass-git-helper/package.nix b/pkgs/by-name/pa/pass-git-helper/package.nix index d5891066cc11..30cec7a4530b 100644 --- a/pkgs/by-name/pa/pass-git-helper/package.nix +++ b/pkgs/by-name/pa/pass-git-helper/package.nix @@ -2,6 +2,7 @@ lib, python3Packages, fetchFromGitHub, + writableTmpDirAsHomeHook, }: python3Packages.buildPythonApplication (finalAttrs: { @@ -20,7 +21,7 @@ python3Packages.buildPythonApplication (finalAttrs: { dependencies = with python3Packages; [ pyxdg ]; - env.HOME = "$TMPDIR"; + nativeBuildInputs = [ writableTmpDirAsHomeHook ]; pythonImportsCheck = [ "passgithelper" ]; diff --git a/pkgs/development/python-modules/haystack-ai/default.nix b/pkgs/development/python-modules/haystack-ai/default.nix index 5a8249999456..fd9700dd0579 100644 --- a/pkgs/development/python-modules/haystack-ai/default.nix +++ b/pkgs/development/python-modules/haystack-ai/default.nix @@ -3,6 +3,7 @@ buildPythonPackage, fetchFromGitHub, hatchling, + writableTmpDirAsHomeHook, boilerpy3, events, httpx, @@ -103,6 +104,7 @@ buildPythonPackage rec { nativeBuildInputs = [ hatchling + writableTmpDirAsHomeHook ]; propagatedBuildInputs = [ @@ -131,8 +133,6 @@ buildPythonPackage rec { transformers ]; - env.HOME = "$(mktemp -d)"; - optional-dependencies = { # all = [ # farm-haystack diff --git a/pkgs/development/python-modules/molecule/default.nix b/pkgs/development/python-modules/molecule/default.nix index 14c7a725c332..762c29351013 100644 --- a/pkgs/development/python-modules/molecule/default.nix +++ b/pkgs/development/python-modules/molecule/default.nix @@ -16,6 +16,7 @@ testers, wcmatch, withPlugins ? true, + writableTmpDirAsHomeHook, molecule-plugins, yamllint, }: @@ -61,7 +62,7 @@ buildPythonPackage rec { }).overrideAttrs (old: { # workaround the error: Permission denied: '/homeless-shelter' - HOME = "$(mktemp -d)"; + nativeBuildInputs = old.nativeBuildInputs ++ [ writableTmpDirAsHomeHook ]; }); meta = {