Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modules: exclude more environment variables #1069

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/modules/top-level.nix
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,17 @@ in

unsetEnvVars = lib.mkOption {
type = types.listOf types.str;
description = "Remove these list of env vars from being exported to keep the shell/direnv more lean.";
description = "A list of removed environment variables to make the shell/direnv more lean.";
# manually determined with knowledge from https://nixos.wiki/wiki/C
default = [
"HOST_PATH"
"NIX_BUILD_CORES"
"__structuredAttrs"
"builder"
"buildInputs"
"buildPhase"
"builder"
"cmakeFlags"
"configureFlags"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we should exclude cmakeFlags, configureFlags and mesonFlags because someone might want to add a library that provides these via hooks to packages to build their C program.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought cmakeFlags + other flags excluded in this PR are in the same category as other already excluded variables.

someone might want to add a library that provides these via hooks to packages to build their C program.

Is this going to work when for example buildInputs is removed from shell (buildInputs is already in unsetEnvVars list ) ?

"depsBuildBuild"
"depsBuildBuildPropagated"
"depsBuildTarget"
Expand All @@ -89,6 +91,8 @@ in
"depsTargetTargetPropagated"
"doCheck"
"doInstallCheck"
"dontAddDisableDepTrack"
"mesonFlags"
"nativeBuildInputs"
"out"
"outputs"
Expand Down