Commit graph

69 commits

Author SHA1 Message Date
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
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
éclairevoyant
598f2257d7
pkgs/top-level/config.nix: add options.allowUnfreePredicate 2024-08-04 14:54:33 -04:00
éclairevoyant
1899a02870
pkgs/top-level/config.nix: add options.allowNonSource 2024-07-29 14:00:40 -04:00
éclairevoyant
f24c3a7f8e
pkgs/top-level/config.nix: nixfmt-rfc-style 2024-07-29 14:00:40 -04:00
Robert Hensing
8f805a0660 pkgs/top-level/config.nix: Refer to test 2024-04-24 12:57:37 +02:00
Weijia Wang
f3a1652b09 Merge branch 'master' into staging-next 2024-04-13 19:10:53 +02:00
stuebinm
170e005a92 pkgs/config: remove uses of lib.mdDoc
this commit is a no-op, as lib.mdDoc was already defined as id.
2024-04-13 10:07:35 -07:00
Philip Taron
a4bed8f2e0
pkgs/top-level/config.nix: fix typo: compatibity to compatibility 2024-04-02 14:47:24 -07:00
Philip Taron
8a034c526e
Avoid with lib; at the top level in pkgs/top-level/config.nix 2024-03-08 14:55:07 -08:00
Martin Weinelt
e720baecf0
config.rocmSupport: init option
Parity with the CUDA option. Useful for example to get a coherent
python package set, without conflicting packages.
2023-11-14 01:50:59 +01:00
Someone Serge
133993211b
config.cudaSupport: init option 2023-07-20 17:57:31 +03:00
pennae
f9ba30270e pkgs/config: add missing mdDoc 2023-06-10 18:17:04 +02:00
Artturin
8ad0103a34 config.structuredAttrsByDefault: add option 2022-12-08 06:13:19 +02:00
pennae
5f53dac66a pkgs/top-level: convert to MD option docs 2022-10-03 14:00:32 +02:00
Profpatsch
1600cba863 Disable checkMeta by default again.
This caused too many downstream projects to break, so we are reverting
this change for now, until further transition fixes are in place.

See discussion in https://github.com/NixOS/nixpkgs/pull/191171

This reverts part of 6762de9a28
2022-10-02 14:28:40 +02:00
piegames
6762de9a28 check-meta.nix: type checking changes
- Enable metadata checking by default, see https://github.com/NixOS/nixpkgs/pull/25304#issuecomment-298385426
- Check metadata before any other package issues, see https://github.com/NixOS/nixpkgs/issues/191124#issuecomment-1246523976
- Document that type checks only apply to the top level of nested values.

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2022-09-25 16:37:15 +02:00
K900
ecb8cf9f68 pkgs/top-level: add a type for warnUndeclaredOptions
Fixes https://hydra.nixos.org/build/190091926/nixlog/1
2022-09-11 07:53:33 +00:00
Sergei Trofimovich
db09d70d33 config.configurePlatformsByDefault: init option
Useful to enable tree-wide occasionally to have incremental progress
towards https://github.com/NixOS/nixpkgs/pull/87909 resolution.
2022-06-21 09:23:13 +01:00
Zhaofeng Li
87de4db5e6 pkgs/config.nix: Fix missing attribute when no config keys are undeclared 2022-06-05 14:55:03 -07:00