diff options
author | Alyssa Ross <hi@alyssa.is> | 2022-02-22 10:43:06 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2022-03-11 16:17:56 +0000 |
commit | ca1aada113c0ebda1ab8667199f6453f8e01c4fc (patch) | |
tree | 55e402280096f62eb0bc8bcad5ce6050c5a0aec7 /nixpkgs/pkgs/stdenv/generic | |
parent | e4df5a52a6a6531f32626f57205356a773ac2975 (diff) | |
parent | 93883402a445ad467320925a0a5dbe43a949f25b (diff) | |
download | nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.tar nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.tar.gz nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.tar.bz2 nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.tar.lz nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.tar.xz nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.tar.zst nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.zip |
Merge commit '93883402a445ad467320925a0a5dbe43a949f25b'
Conflicts: nixpkgs/nixos/modules/programs/ssh.nix nixpkgs/pkgs/applications/networking/browsers/firefox/packages.nix nixpkgs/pkgs/data/fonts/noto-fonts/default.nix nixpkgs/pkgs/development/go-modules/generic/default.nix nixpkgs/pkgs/development/interpreters/ruby/default.nix nixpkgs/pkgs/development/libraries/mesa/default.nix
Diffstat (limited to 'nixpkgs/pkgs/stdenv/generic')
-rw-r--r-- | nixpkgs/pkgs/stdenv/generic/check-meta.nix | 13 | ||||
-rw-r--r-- | nixpkgs/pkgs/stdenv/generic/default.nix | 7 | ||||
-rw-r--r-- | nixpkgs/pkgs/stdenv/generic/setup.sh | 8 |
3 files changed, 21 insertions, 7 deletions
diff --git a/nixpkgs/pkgs/stdenv/generic/check-meta.nix b/nixpkgs/pkgs/stdenv/generic/check-meta.nix index ba3c8eef20e6..44caa6838e8d 100644 --- a/nixpkgs/pkgs/stdenv/generic/check-meta.nix +++ b/nixpkgs/pkgs/stdenv/generic/check-meta.nix @@ -119,13 +119,20 @@ let } ''; + # flakeNote will be printed in the remediation messages below. + flakeNote = " + Note: For `nix shell`, `nix build`, `nix develop` or any other Nix 2.4+ + (Flake) command, `--impure` must be passed in order to read this + environment variable. + "; + remediate_allowlist = allow_attr: rebuild_amendment: attrs: '' a) To temporarily allow ${remediation_phrase allow_attr}, you can use an environment variable for a single invocation of the nix tools. $ export ${remediation_env_var allow_attr}=1 - + ${flakeNote} b) For `nixos-rebuild` you can set { nixpkgs.config.allow${allow_attr} = true; } in configuration.nix to override this. @@ -148,7 +155,7 @@ let variable for a single invocation of the nix tools: $ export NIXPKGS_ALLOW_INSECURE=1 - + ${flakeNote} b) for `nixos-rebuild` you can add ‘${getName attrs}’ to `nixpkgs.config.permittedInsecurePackages` in the configuration.nix, like so: @@ -236,7 +243,6 @@ let name = str; version = str; tag = str; - updateWalker = bool; executables = listOf str; outputsToInstall = listOf str; position = str; @@ -244,7 +250,6 @@ let repositories = attrsOf str; isBuildPythonPackage = platforms; schedulingPriority = int; - downloadURLRegexp = str; isFcitxEngine = bool; isIbusEngine = bool; isGutenprint = bool; diff --git a/nixpkgs/pkgs/stdenv/generic/default.nix b/nixpkgs/pkgs/stdenv/generic/default.nix index 49ebc67f854e..4fb98e5e8013 100644 --- a/nixpkgs/pkgs/stdenv/generic/default.nix +++ b/nixpkgs/pkgs/stdenv/generic/default.nix @@ -112,7 +112,7 @@ let # are absolute unless we go out of our way to make them relative (like with CF) # TODO: This really wants to be in stdenv/darwin but we don't have hostPlatform # there (yet?) so it goes here until then. - preHook = preHook+ lib.optionalString buildPlatform.isDarwin '' + preHook = preHook + lib.optionalString buildPlatform.isDarwin '' export NIX_DONT_SET_RPATH_FOR_BUILD=1 '' + lib.optionalString (hostPlatform.isDarwin || (hostPlatform.parsed.kernel.execFormat != lib.systems.parse.execFormats.elf && hostPlatform.parsed.kernel.execFormat != lib.systems.parse.execFormats.macho)) '' export NIX_DONT_SET_RPATH=1 @@ -168,6 +168,11 @@ let inherit overrides; inherit cc hasCC; + + # Convenience for doing some very basic shell syntax checking by parsing a script + # without running any commands. Because this will also skip `shopt -s extglob` + # commands and extglob affects the Bash parser, we enable extglob always. + shellDryRun = "${stdenv.shell} -n -O extglob"; } # Propagate any extra attributes. For instance, we use this to diff --git a/nixpkgs/pkgs/stdenv/generic/setup.sh b/nixpkgs/pkgs/stdenv/generic/setup.sh index 2951813c0f71..0777fa830c10 100644 --- a/nixpkgs/pkgs/stdenv/generic/setup.sh +++ b/nixpkgs/pkgs/stdenv/generic/setup.sh @@ -1,3 +1,5 @@ +# shellcheck shell=bash +__nixpkgs_setup_set_original=$- set -eu set -o pipefail shopt -s inherit_errexit @@ -1361,5 +1363,7 @@ runHook userHook dumpVars -# Disable nounset for nix-shell. -set +u +# Restore the original options for nix-shell +[[ $__nixpkgs_setup_set_original == *e* ]] || set +e +[[ $__nixpkgs_setup_set_original == *u* ]] || set +u +unset -v __nixpkgs_setup_set_original |