Commit graph

21 commits

Author SHA1 Message Date
Wolfgang Walther e32b9df95b
default.nix: fix typo 2025-10-29 18:41:03 +01:00
Wolfgang Walther ab4281e967
lib/minfeatures: init from minver.nix
The concept of having a "minimum supported Nix version" doesn't work
anymore today, for the following reasons:
- With multiple forks / implementations of Nix available, their feature
sets and versions will differ. We'd need *multiple* minimum versions,
one for each implementation.
- Lix does not expose its real version. It only reports "2.18.3-lix",
even though its real version is in the 2.90+ range.
- A minimum version has the expectation that it could be *raised* in the
future. That's not possible with Lix, because Lix will always and
forever report the above version.
- A minimum version has the expectation that *all* versions bigger than
the minimum are supported. That was already quite a stretch when minver
was 2.3 and none of the Nix versions between 2.4 and 2.23 were packed
anymore. But it's impossible for us to test all these non-LTS versions
anyway: We don't have Nix 2.18, 2.19, 2.20, 2.21, 2.22, 2.23, 2.25, 2.26
and 2.27 available in Nixpkgs at the time of this writing.

With their policy around `builtins.nixVersion`, Lix forces our hand: We
need to replace minver.nix with a "feature detection" mechanism.

This PR introduces the first two features:
- The availability of `builtins.nixVersion`: If this is not available,
the version of Nix is so old, that we surely don't support it anymore.
- The value of `builtins.nixVersion` being greater or equal to 2.18.

Note, that this does **not** imply support for Nix 2.18. Instead,
explicitly supported versions of Lix and Nix are only these that we
actually test against.

If, eventually, we realize that the supported versions have advanced and
Nixpkgs has adopted a feature only available in newer versions, we will
have to add a feature check for this.

Put differently: The list of features in `minfeatures.nix` is not
expected to be complete. It's a list of known-to-be-bad conditions that
will cause problems when evaluating Nixpkgs. Their only purpose is to be
able to show a helpful error message. Some other versions might also not
be supported, but might fail with more subtle errors. That's just
reality and has always been the case previously as well.
2025-08-22 12:47:13 +02:00
Jade Lovelace 6e0313d24e default.nix: say which old Nix version is being used
We are hitting a long tail of problems at work related to old nix-direnv
sneaking old nix versions in that would be fixed by
https://github.com/nix-community/nix-direnv/pull/513, except that the
issue is that nix-direnv itself is too old.

It would at least be very helpful to print out *what* ancient nix
version is at fault.
2025-08-21 14:56:06 -07:00
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00
lf- 6ed65d9b5f docs: add -L to remaining curl install commands 2020-09-11 12:14:07 -07:00
Thomas Tuegel 9da2134cfa
Fix local path to release notes in error message
The error message when produced when Nix is too old refers the user to a local
copy of the NixOS release notes, but the provided path is incorrect.
2018-10-08 05:43:15 -05:00
Graham Christensen a6a0005fed
Reference a local copy of the release notes in the 'version too old' warning, plus a redirect to the support links 2018-08-30 09:05:57 -04:00
Graham Christensen d8f5f49dfe
Reference release notes in the 'version too old' warning 2018-08-30 09:00:05 -04:00
leenaars b197363ea7 Update message to reflect nix 2.0 availability of imperative nix-update (#36123) 2018-06-25 00:35:06 +02:00
Tuomas Tynkkynen 2e91b2d585 default.nix: Provide correct instructions how to upgrade Nix
Supersedes #17631.
2017-03-18 21:04:07 +02:00
John Ericson 4af2bf6663 Separate fix-point from config importing hacks and other impurities 2016-07-14 14:33:23 -07:00
Nicolas B. Pierron ad31783405 Extract the top-level logic out of all-packages.nix into pkgs/top-level/default.nix 2016-03-20 16:28:18 +00:00
Rommel M. Martinez 31a20f38ac Expose minimum required Nix version. 2015-11-26 23:11:11 +08:00
Eelco Dolstra 2e5b6362ae Bump minimum required Nix version
Issue #10337.
2015-10-15 13:19:51 +02:00
Domen Kožar 1defdb972e if we abort with too old Nix, hint docs 2015-01-21 21:41:40 +01:00
Shea Levy 8921a8f53b Revert "Revert "mkOverridable: Use functors to allow overridable functions""
Original commit was reverted due to using features from a newer nix than
hydra had, hydra has since been updated

This reverts commit 07e726c85c.
2015-01-13 08:39:54 -05:00
Rob Vermaas 07e726c85c Revert "mkOverridable: Use functors to allow overridable functions"
This reverts commit 4ee556cfe9.
2015-01-13 13:53:11 +01:00
Shea Levy 4ee556cfe9 mkOverridable: Use functors to allow overridable functions 2015-01-09 13:26:34 -05:00
Domen Kožar 476ca07d8e require Nix 1.7 for nixpkgs, since we're using antiquotation inside quoted attribute sets 2014-09-04 18:44:03 +02:00
Eelco Dolstra 14af15dbff Explicitly require Nix 1.6
People using Nix < 1.6 previously got an unhelpful "infinite
recursion" error.
2014-03-17 11:33:36 +01:00
Eelco Dolstra f95b22c621 * For convenience, provide a top-level Nix expression that simply
imports all-packages.nix.

svn path=/nixpkgs/trunk/; revision=8610
2007-04-26 14:32:57 +00:00