From b72cf0a46626b032b0c1f2a4a3a47d20fbd1ad09 Mon Sep 17 00:00:00 2001 From: Robin Quintero Date: Mon, 19 Feb 2024 15:55:05 -0500 Subject: [PATCH] feat(docs): #1296 add note about homeless-shelter - Add note about homeless-shelter in the python extension documentation to make sure that the user knows that we delete this directory and change the `HOME` variable to assure purity of builds without sandboxing. Signed-off-by: Robin Quintero --- docs/src/api/extensions/fundamentals.md | 16 ++++++++-------- docs/src/api/extensions/python.md | 12 ++++++++++++ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/docs/src/api/extensions/fundamentals.md b/docs/src/api/extensions/fundamentals.md index 2f13d66e..30fffa81 100644 --- a/docs/src/api/extensions/fundamentals.md +++ b/docs/src/api/extensions/fundamentals.md @@ -527,14 +527,14 @@ Types: to `projectStateDir` otherwise. Defaults to `false`, if `projectStateDir` is specified or derived. - Note: - - - It is implicitly `true`, if `projectStateDir == globalStateDir`. - - `projectStateDir == globalStateDir` is the default if - `projectIdentifier` is not configured. - - Hence, generally enable project local state by - - either setting `projectIdentifier` - - or `projectStateDir` different from `globalStateDir`. + ???+ note + + - It is implicitly `true`, if `projectStateDir == globalStateDir`. + - `projectStateDir == globalStateDir` is the default if + `projectIdentifier` is not configured. + - Hence, generally enable project local state by + - either setting `projectIdentifier` + - or `projectStateDir` different from `globalStateDir`. Example: diff --git a/docs/src/api/extensions/python.md b/docs/src/api/extensions/python.md index 5e81eb29..b6e7bfd6 100644 --- a/docs/src/api/extensions/python.md +++ b/docs/src/api/extensions/python.md @@ -24,6 +24,12 @@ Types: For more information see [here](https://github.com/nix-community/poetry2nix/blob/master/docs/edgecases.md). Defaults to `(self: super: {})`. + ???+ note + + By default we override every python package deleting the + `homeless-shelter` directory and changing the `HOME` variable, + we make this to assure purity of builds without sandboxing. + Example: === "main.nix" @@ -43,6 +49,12 @@ Example: overrides = self: super: { pygments = super.pygments.overridePythonAttrs ( old: { + preUnpack = + '' + export HOME=$(mktemp -d) + rm -rf /homeless-shelter + '' + + (old.preUnpack or ""); buildInputs = [super.setuptools]; } );