Skip to content

Commit

Permalink
feat(build): fluidattacks#1282 assure purity removing dir
Browse files Browse the repository at this point in the history
- Set `HOME` to a temp dir
- Remove `homeless-shelter` dir if it exists

Signed-off-by: Robin Quintero <rohaquinlop301@gmail.com>
  • Loading branch information
rohaquinlop committed Jan 26, 2024
1 parent 7503b44 commit 921536a
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions src/args/make-python-environment/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,25 @@
}
.${pythonVersion};

env = poetry2nix.mkPoetryEnv {
overrides = poetry2nix.defaultPoetryOverrides.extend overrides;
inherit preferWheels;
projectDir = pythonProjectDir;
inherit python;
};
env =
poetry2nix.mkPoetryEnv
{
overrides = poetry2nix.defaultPoetryOverrides.extend overrides;
inherit preferWheels;
projectDir = pythonProjectDir;
inherit python;
}
.env
.overrideAttrs (
old: {
preUnpack =
(old.preUnpack or "")
+ ''
export HOME=$(mktemp -d)
rm -rf /homeless-shelter
'';
}
);
in
makeSearchPaths {
bin = [env];
Expand Down

0 comments on commit 921536a

Please sign in to comment.