Commit Graph

87 Commits

Author SHA1 Message Date
Johannes Kirschbauer
d4cc798ef8 Revert "Reapply "nixos/nixpkgs.config: make use of the module defined in config.nix""
This reverts commit e701ff054b.
2026-08-09 21:03:35 +02:00
Johannes Kirschbauer
e701ff054b Reapply "nixos/nixpkgs.config: make use of the module defined in config.nix"
Reapplies #517762, reverted in #518791.

Pass config = {} explicitly to prevent impure.nix from filling it
from NIXPKGS_CONFIG. This is equivalent to the old behavior where
inherit (cfg) config always overrode the impure.nix default.
2026-08-06 20:37:29 +02:00
Martin Weinelt
9ade44f1d4 Merge remote-tracking branch 'origin/staging' into staging-next
Conflicts:
- pkgs/top-level/nixpkgs-basic-release-checks.nix
2026-06-27 01:13:12 +02:00
Silvan Mosberger
7cc4d7dea8 config: Introduce attrPathsDisallowedForInternalUse
This is very similar to how the aliases.nix overlay can be removed to
prevent usage of them in Nixpkgs itself, but this config attribute
allows preventing use of other existing attributes in Nixpkgs.

Needed for a follow-up commit.
2026-06-24 12:25:54 +02:00
Emily
90796a20f3 top-level: add error for x86_64-darwin deprecation 2026-06-21 19:31:25 +01:00
Philip Taron
56b4ce710e fetchurl: drop stale rewriteURL defaultText
The `rewriteURL` default was changed from `lib.id` to `null`, but the
`defaultText` override still rendered it as `(url: url)` in the manual.
`null` is a primitive the option-doc system renders natively, so just
drop the override.

Assisted-by: Claude Code (claude-opus-4-8)
2026-06-10 13:00:12 -07:00
Eman Resu
62972398d8 fetchurl: avoid rewriteURL logic if it's null 2026-06-01 23:18:10 -04:00
Martin Weinelt
6cba250893 Revert "Reapply "nixos/nixpkgs.config: make use of the module defined in config.nix"" 2026-05-10 20:27:56 +02:00
Johannes Kirschbauer
86cd4e7bc8 Reapply "nixos/nixpkgs.config: make use of the module defined in config.nix"
This reverts commit a06a6caa6b.
2026-05-07 19:11:47 +02:00
K900
a06a6caa6b Revert "nixos/nixpkgs.config: make use of the module defined in config.nix" 2026-05-07 15:38:29 +03:00
Johannes Kirschbauer
f18d5e3936 nixos/nixpkgs.config: use mkDefault for _module.args.docPrefix 2026-05-04 10:05:11 +02:00
Johannes Kirschbauer
1d1e96211e nixos/nixpkgs.config: use deferredModule to avoid double evaluation
Switch the option type to `deferredModuleWith`, which collects definitions without evaluating them.
The raw definitions are forwarded to nixpkgs function via a new internal `_configDefinitions` parameter.

`apply` on the option returns `finalPkgs.config`, preserving
backwards compatibility for external readers of `config.nixpkgs.config`
2026-05-04 10:05:11 +02:00
jopejoe1
2e8702164b config.nix: add optional docPrefix
Makes it possible to render it in the NixOS manual,
as that one does not contain the Nixpkgs manual specific ones.
2026-04-23 12:34:11 +02:00
jopejoe1
cbcbede8e0 config.nix: document packageOverrides and perlPackageOverrides
These are handled in the NixOS modules for `nixpkgs.config` as special merges; add them here.
2026-04-23 12:34:01 +02:00
·𐑑𐑴𐑕𐑑𐑩𐑤
a0d0b06495 treewide: fix typo of NPM → npm 2026-04-03 19:08:04 +07:00
Wolfgang Walther
68ec46f43f recurseIntoAttrsWith: init (#482817) 2026-03-31 14:28:51 +00:00
Silvan Mosberger
2e97caa6d3 stdenv: Use meta.problems for meta.broken underneath
And add tests for it
2026-03-13 19:36:57 +01:00
Emily
4a20fb1916 top-level: add warning for x86_64-darwin deprecation
We’ve never deprecated a platform in widespread use before, and it
seems prudent to warn users about the upcoming end of support so they
can plan appropriately.

I tried to make this relatively unobtrusive by taking advantage of
the import cache and offering a way to turn it off, but I anticipate
there might still be issues with e.g. `nix shell nixpkgs#…` and
spammy warnings from multiple instantiations of Nixpkgs. I’m
not sure there’s much we can do about that unless we take a
different strategy entirely; `nix shell --impure nixpkgs#…` with a
`~/.config/nixpkgs/config.nix` is about the best UX we can hope to
offer with the restrictions of flakes.
2026-02-27 22:27:02 +00:00
Silvan Mosberger
27dd434480 stdenv.mkDerivation: Initial RFC 127 implementation
See https://github.com/NixOS/rfcs/blob/master/rfcs/0127-issues-warnings.md

Co-Authored-By: piegames <git@piegames.de>
Co-Authored-By: AkechiShiro <14914796+AkechiShiro@users.noreply.github.com>
2026-02-26 14:53:30 +01:00
Emily
ec070a136c config: add stub allowDeprecatedx86_64Darwin option 2026-02-22 18:52:16 +00:00
jopejoe1
1a105443c9 config: add recursionMode
This makes it possible to change the recursion of attrsets
depending on if we are evaling for search, hydra or eval
2026-01-28 19:54:05 +01:00
Yureka
918178a9c9 nixos/misc/nixpkgs add setting nixpkgs.config.allowUnfreePackages = ["list" "of" "packages"] (#396595) 2026-01-27 11:14:29 +00:00
byteforge38
d6f8f7b7b1 config: add replaceStdenv, cudaCapabilities, cudaForwardCompat options 2026-01-11 20:36:36 -08:00
‮rekcäH nitraM‮
a3c9221d64 nixos/misc/nixpkgs: add setting nixpkgs.config.allowUnfreePackages = ["list" "of "packages"]
Inspired by https://github.com/NixOS/nixpkgs/issues/197325 this adds a
new option nixpkgs.allowUnfreePackages, which merges additively and can
thus be defined in multiple modules close to where the unfree package is
installed.

I would have liked ot name this option
nixpkgs.config.allowUnfreePackages, to define it closer to where the
allowUnfree and allowUnfreePredicate are defined, but I didn't see how
this could be achived. I would welcome some guidance on how to do this.
2026-01-03 20:40:33 +01:00
K900
6ddff44990 Merge remote-tracking branch 'origin/staging-next' into staging 2025-11-01 11:19:41 +03:00
Connor Baker
f6a38f9a4e Revert "config: add and document {allow,block}listedLicenses"
This reverts commit f5deefd463.

See:

- https://github.com/NixOS/nixpkgs/pull/437723 (introduced commit)
- https://github.com/NixOS/nixpkgs/issues/456994 (reported breakage)
- https://github.com/NixOS/nixpkgs/pull/457038 (attempted fix, closed in favor of this revert)
- https://github.com/NixOS/nixpkgs/pull/457120 (fix which would require more breaking changes)
2025-10-31 12:25:46 -07:00
nixpkgs-ci[bot]
6a088f5b69 Merge staging-next into staging 2025-10-28 00:17:14 +00:00
Connor Baker
f5deefd463 config: add and document {allow,block}listedLicenses
Signed-off-by: Connor Baker <ConnorBaker01@gmail.com>
2025-10-22 13:14:22 -07:00
Alexander Bantyev
712a4af338 fixup! config: add npmRegistryOverrides option 2025-10-17 16:41:50 +04:00
Alexander Bantyev
c3a465a6de config: add npmRegistryOverrides option
Adds npmRegistryOverrides, to be passed through to `fetchNpmDeps`.
2025-10-17 15:19:57 +04:00
Silvan Mosberger
56f680d915 fetchurl: Allow hashed mirror overriding with config.hashedMirrors
Allows having alternate hashed mirrors as fallbacks. Useful in case the
default hashed mirror is not accessible or doesn't have everything
needed.

Co-authored-by: Johan Herland <johan.herland@tweag.io>
Co-authored-by: Yuriy Taraday <yuriy.taraday@tweag.io>
Co-authored-by: Alexander Bantyev <balsoft@balsoft.ru>
2025-10-06 14:15:10 +02:00
NAHO
c8d4dabc43 pkgs: remove optional builtins prefixes from prelude functions
Remove optional builtins prefixes from prelude functions by running:

    builtins=(
      abort
      baseNameOf
      break
      derivation
      derivationStrict
      dirOf
      false
      fetchGit
      fetchMercurial
      fetchTarball
      fetchTree
      fromTOML
      import
      isNull
      map
      null
      placeholder
      removeAttrs
      scopedImport
      throw
      toString
      true
    )

    fd \
      --type file \
      . \
      pkgs \
      --exec-batch sed --in-place --regexp-extended "
        s/\<builtins\.($(
          printf '%s\n' "${builtins[@]}" |
            paste --delimiter '|' --serial -
        ))\>/\1/g
      "

    nix fmt
2025-10-04 19:02:37 +02:00
Silvan Mosberger
aff78f7433 config: fix a typo 2025-09-29 23:37:59 +02:00
Alexander Bantyev
80d9975bd4 config: add a gitConfig/gitConfigFile option
Adds a `gitConfig` option (and `gitConfigFile`), to set a default
`gitConfigFile` argument for `fetchgit`.
2025-09-29 22:34:54 +02:00
Ross Smyth
aa4a380548 config: Add microsoftVisualStudioLicenseAccepted option for MSVC 2025-07-28 02:02:55 -04:00
lassulus
78f051e8af lib, treewide: introduce repoRevToName and use it to cleanup most fetch* functions (#316668) 2025-06-10 22:49:23 +02:00
Johan Herland
abda866f17 fetchurl: Add hook for rewriting/filtering URLs
This allows on-the-fly rewriting of URLs before they are passed from
fetchurl (or fetchurlBoot) to curl.

The intended use is to allow inserting company-internal mirrors, or
working around company firewalls and similar network restrictions,
without having to extensively patch across all of nixpkgs. Instead,
users can pass a function in their nixpkgs that performs the necessary
URL rewrites.

Co-authored-by: Alexander Bantyev <balsoft@balsoft.ru>
2025-06-04 10:29:08 +00:00
Jan Malakhovski
7c8a4efb68 lib, treewide: introduce repoRevToName, use it in most fetch* functions
This patch adds `lib.repoRevToName` function that generalizes away most of the
code used for derivation name generation by `fetch*` functions (`fetchzip`,
`fetchFromGitHub`, etc, except those which are delayed until latter commits
for mass-rebuild reasons).

It's first argument controls how the resulting name will look (see below).

Since `lib` has no equivalent of Nixpkgs' `config`, this patch adds
`config.fetchedSourceNameDefault` option to Nixpkgs and then re-exposes
`lib.repoRevToName config.fetchedSourceNameDefault` expression as
`pkgs.repoRevToNameMaybe` which is then used in `fetch*` derivations.

The result is that different values of `config.fetchedSourceNameDefault` now
control how the `src` derivations produced by `fetch*` functions are to be
named, e.g.:

- `fetchedSourceNameDefault = "source"` (the default):

  ```
  $ nix-instantiate -A fuse.src
  /nix/store/<hash>-source.drv
  ```

- `fetchedSourceNameDefault = "versioned"`:

  ```
  $ nix-instantiate -A fuse.src
  /nix/store/<hash>-libfuse-2.9.9-source.drv
  ```

- `fetchedSourceNameDefault = "full"`:

  ```
  $ nix-instantiate -A fuse.src
  /nix/store/<hash>-libfuse-2.9.9-github-source.drv
  ```

See the documentation of `config.fetchedSourceNameDefault` for more info.
2025-05-31 10:01:21 +00:00
Jan Malakhovski
27b01599c5 pkgs/top-level/config.nix: remove some unneded lines 2025-05-31 10:01:21 +00:00
Tristan Ross
14386224a1 pkgs/top-level/stage.nix: move most nixpkgs sets to variants 2025-05-17 18:03:57 -07:00
Silvan Mosberger
374e6bcc40 treewide: Format all Nix files
Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:

  nix-build ci -A fmt.check

This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).

This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).

Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](8616af08d9/maintainers/scripts/auto-rebase).

If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.
2025-04-01 20:10:43 +02:00
w
d7ec977f86 stdenv: Allow user to supply their bootstrapFiles set of tools 2024-08-30 02:31:18 +00:00
éclairevoyant
1188923cde Revert "pkgs/top-level/config.nix: nixfmt, declare options" 2024-08-05 16:44:45 +00:00
éclairevoyant
87e58be23b pkgs/top-level/config.nix: add options.{allow,block}listedLicenses 2024-08-05 01:10:06 -04:00
éclairevoyant
1d47396274 pkgs/top-level/config.nix: add options.inHydra 2024-08-05 01:10:06 -04:00
éclairevoyant
d442a38364 pkgs/top-level/config.nix: add options.handleEvalIssue 2024-08-05 01:10:06 -04:00
éclairevoyant
36c0423211 pkgs/top-level/config.nix: add options.checkMetaRecursively 2024-08-05 01:10:06 -04:00
éclairevoyant
139f90426b pkgs/top-level/config.nix: add options.{permittedInsecurePackages,allowInsecurePredicate} 2024-08-05 01:10:06 -04:00
éclairevoyant
0e7bb498f2 pkgs/top-level/config.nix: add options.packageOverrides 2024-08-04 14:54:34 -04:00
éclairevoyant
333370df4f pkgs/top-level/config.nix: add options.allowNonSourcePredicate 2024-08-04 14:54:34 -04:00