5083 Commits

Author SHA1 Message Date
Emily
0c19eb3e55 lib/systems: unify ARMv5 platforms with stock kernel configuration
The `sheevaplug` kernel configuration was added a very long time
ago and has not been adjusted for years. `pogoplug4` was identical
to `sheevaplug` except for an even more stripped‐down kernel
configuration, no device tree support, and a different load address
for the uImage.

These days, the stock kernel configuration builds and there has been
an upstream device tree for the Pogoplug Series 4 for years; unify
`sheevaplug` and `pogoplug4` into an `armv5tel-multiplatform` that
uses the standard configuration.

ARMv5 was also the only platform that defaulted to uImage, the [legacy
U‐Boot image format] that is deprecated upstream. Our bootloader
machinery in NixOS does not handle these images in any special way
and even the original ARMv6 Raspberry Pi platform defaults to the
standard zImage. We switch `armv5tel-multiplatform` to zImage to match.

[legacy U‐Boot image format]: https://docs.u-boot.org/en/latest/usage/cmd/bootm.html#legacy-boot

It is of course natural to worry about backwards compatibility
here: this switches to a different kernel image format and drops
support for root on NFS along with random oddities like KGDB and
LatencyTOP. Renaming the platform is intended to help mitigate
this risk.

The reality, however, is that it is currently very
difficult to build a configuration for ARMv5. I found
<https://github.com/thefloweringash/sheevaplug-nix> online as
an example configuration from many years ago; it already set
`autoModules`, and builds U‐Boot using `CONFIG_DISTRO_DEFAULTS`,
which should work out of the box without requiring the legacy U‐Boot
image format.

Even then, however, I confirmed with the author that it hasn’t
been used in years, and I could barely get it to build with
a modern Nixpkgs: OpenSSH is broken, Nix is broken, multiple
default `environment.systemPackages` in the SD image profile
are broken, `boot.initrd.includeDefaultModules` is broken, and
`hardware.enableAllHardware` is broken.

I conclude that if anyone is actively building systems on ARMv5, they
have a forked Nixpkgs or a very custom setup. Given our general move
to standard boot chains and no platform‐specific hacks, and the
decaying state of our unofficial support for 32‐bit ARM, I think
it is not worth maintaining support for the legacy image format for
this one ancient platform.

If anyone is running a heavily stripped‐down NixOS configuration on
mission‐critical SheevaPlugs using a custom Nix‐free deployment
setup relying on the legacy U‐Boot image format and somehow none
of these kernel changes manage to loudly break their build, hopefully
they’ll at least notice the release notes entry! Otherwise there’s
always JTAG…
2026-06-01 11:12:17 +10:00
Emily
af6485561c lib/systems: remove unused platforms
These were not used by the selection logic or
`lib/systems/examples.nix`, so any consumer would have to be including
them explicitly. Since we’re moving away from setting Linux kernel
configuration in the platform structure, breaking these explictily
won’t reduce the convenience and will help signal to any such expert
users that they need to move their kernel configuration elsewhere.
2026-06-01 11:12:17 +10:00
Emily
9c5ca61078 lib/systems: remove broken kernel configurations
None of these successfully build a kernel, and as we’re moving
away from putting kernel configuration in the platform structure and
don’t package the vendor kernels that all but `fuloong2f_n32` expect,
there’s no point to keeping these kernel configurations in Nixpkgs.
2026-06-01 11:12:17 +10:00
Emily
d408bc4f02 lib/systems: remove obsolete KS8851_MLL workaround
This was fixed by 51bb08dd04a05035a64504faa47651d36b0f3125 upstream,
which is in all our supported kernels ≥ 5.12.
2026-06-01 11:12:17 +10:00
Emily
c76c290c14 lib/systems: remove redundant kernel configuration
These are now already set upstream and should result in no change,
even for the Raspberry Pi vendor kernels.
2026-06-01 11:12:17 +10:00
Emily
53f91beef8 lib/systems: remove unused linux-kernel.Major field 2026-06-01 11:12:17 +10:00
Emily
b59952e523 lib/systems: don’t specify multi_v7_defconfig explicitly
This has been the default for `defconfig` upstream since
32872c04ffd5a855c43802c5aa76c711eb021948, which is in all our
supported kernels.
2026-06-01 11:12:17 +10:00
Emily
1c935b9fd9 lib/systems: drop gnu64_simplekernel
This was unused apart from a commented‐out test, and we’re moving
away from specifying kernel configuration in the platform structure.
2026-05-30 14:12:51 +10:00
Yt
a26e677695 python3Packages.emmiai-noether: init at 2026.4.0 (#525203) 2026-05-28 16:28:27 +00:00
Philip Taron
19bd880f94 various: remove lib.warnIf from most critical functions (#524541) 2026-05-28 15:50:31 +00:00
Sandro
489cd7957b netboxPlugins.netbox-custom-objects: init at 0.5.1 (#523936) 2026-05-28 12:55:58 +00:00
Gaetan Lepage
8396e4b976 licenses: add enpl, Emmi AI Non-Production License 2026-05-28 12:41:55 +00:00
adisbladis
c0d82318ed lib.generators.toGitINI: performance improvements (#522818) 2026-05-28 06:27:54 +00:00
Eman Resu
3ec1e90b10 lib/modules: remove warnIf usage
warnIf sends our warning message through a function call, even if the
warning condition doesn't trigger. This requires a lot of thunk
allocation that can be easily avoided.
2026-05-28 00:19:32 -04:00
Philip Taron
e03d0a783d various: reduce // merges, optimize ++ chains across hot paths (#506793) 2026-05-27 22:06:37 +00:00
Nico Felbinger
405f08f765 licenses: init netboxLimitedUse 2026-05-27 18:39:06 +02:00
zimbatm
01bdc186ae lib.sources.sourceByGlobs: address review comments 2026-05-26 21:49:00 +12:00
adisbladis
59d55cbaa3 lib.sources.sourceByGlobs: init function
Adds a source filtering function inspired by [doublestar](https://github.com/bmatcuk/doublestar).

This has been in used in a few private repositories since the last ~6 months with success.

- Testing

This was originally tested with the nix-unit testsuite:
```
let
  inherit (import ./internal.nix) mkSourceFilter mkMatcher;
in
{
  mkMatcher = {
    empty = {
      testMatch = {
        expr = mkMatcher "" "" "regular";
        expected = true;
      };

      testNoMatch = {
        expr = mkMatcher "" "foo" "regular";
        expected = false;
      };
    };

    simple = {
      testMatch = {
        expr = mkMatcher "foo" "foo" "regular";
        expected = true;
      };

      testNoMatch = {
        expr = mkMatcher "foo" "bar" "regular";
        expected = false;
      };
    };

    singleStar = {
      testMatch = {
        expr = mkMatcher "*.js" "foo.js" "regular";
        expected = true;
      };

      testNoMatch = {
        expr = mkMatcher "*.js" "foo.py" "regular";
        expected = false;
      };
    };

    doubleStar = {
      testMatch = {
        expr = mkMatcher "foo/**/bar" "foo/baz/bar" "regular";
        expected = true;
      };

      testNoMatch = {
        expr = mkMatcher "foo/**/bar" "foo/bar/baz" "regular";
        expected = false;
      };

      testMultiMatch = {
        expr = mkMatcher "foo/**/bar" "foo/baz/xyz/bar" "regular";
        expected = true;
      };

      testMultiMatchDoubleGlob = {
        expr = mkMatcher "foo/**/**/bar" "foo/baz/xyz/bar" "regular";
        expected = true;
      };

      testInfixMatch = {
        expr = mkMatcher "foo/**/qux/**/bar" "foo/baz/qux/baz/bar" "regular";
        expected = true;
      };

      testInfixNoMatch = {
        expr = mkMatcher "foo/**/xyz/**/bar" "foo/baz/qux/baz/bar" "regular";
        expected = false;
      };

      # Technically a partial match
      testInfixDirMatch = {
        expr = mkMatcher "foo/**/xyz/**/bar" "foo/baz/qux/baz/bar" "directory";
        expected = true;
      };
    };
  };

  mkSourceFilter = {
    testSourceFilter = {
      expr = mkSourceFilter ./fixtures [
        "bar/*.js"
      ] "bar/bar.js" "regular";
      expected = true;
    };
  };
}
```
but it was dropped in this nixpkgs contribution as the structure of nixpkgs lib testing is too primitive to incorp this without more extensive refactoring than I'd like at the momment.

- Performance

It's hard to benchmark this against anything else meaningful except [globsset](https://github.com/pdtpartners/globset), which has a very similar API.

`sourceByGlobs` avoids performance pitfalls by:

  - Using `builtins.filterSource`

      This is more performant than the fileset API.
      The downside compared to the fileset API is that any directory which matches the filter will be added to the build, even if it's empty.

  - Match paths component by component

      By splitting each pattern into a token per / separator.
      This is much faster in Nix than the doublestar algorithm.

- Globset source

```json
{
    "cpuTime": 0.8585879802703857,
    "envs": {
        "bytes": 148252864,
        "elements": 11899843,
        "number": 6631765
    },
    "gc": {
        "heapSize": 402915328,
        "totalBytes": 671288560
    },
    "list": {
        "bytes": 3358664,
        "concats": 28658,
        "elements": 419833
    },
    "nrAvoided": 11562713,
    "nrFunctionCalls": 4816963,
    "nrLookups": 4316209,
    "nrOpUpdateValuesCopied": 5686407,
    "nrOpUpdates": 464060,
    "nrPrimOpCalls": 2966970,
    "nrThunks": 7796186,
    "sets": {
        "bytes": 196404672,
        "elements": 10837802,
        "number": 1437490
    },
    "sizes": {
        "Attr": 16,
        "Bindings": 16,
        "Env": 8,
        "Value": 24
    },
    "symbols": {
        "bytes": 340652,
        "number": 32026
    },
    "values": {
        "bytes": 207367440,
        "number": 8640310
    }
}
```

- Glob-filter source

```json
{
    "cpuTime": 0.3904629945755005,
    "envs": {
        "bytes": 13263440,
        "elements": 1005877,
        "number": 652053
    },
    "gc": {
        "heapSize": 402915328,
        "totalBytes": 146914896
    },
    "list": {
        "bytes": 3032168,
        "concats": 5899,
        "elements": 379021
    },
    "nrAvoided": 1666598,
    "nrFunctionCalls": 484399,
    "nrLookups": 112698,
    "nrOpUpdateValuesCopied": 3432135,
    "nrOpUpdates": 13426,
    "nrPrimOpCalls": 1041954,
    "nrThunks": 1205792,
    "sets": {
        "bytes": 64304800,
        "elements": 3978167,
        "number": 40883
    },
    "sizes": {
        "Attr": 16,
        "Bindings": 16,
        "Env": 8,
        "Value": 24
    },
    "symbols": {
        "bytes": 285306,
        "number": 28864
    },
    "values": {
        "bytes": 42963240,
        "number": 1790135
    }
}
```
2026-05-26 21:48:59 +12:00
Robert Hensing
ccbf6da64e types.attrList: init (#510698) 2026-05-25 11:34:46 +00:00
Johannes Kirschbauer
ae142b5738 types.attrListWith: review fixes
- Improve extractItem error messages: distinguish non-attrset elements
  from multi-key attrsets, and include the faulty definition via showDefs.
- Use isType instead of raw _type access for order detection.
- Disable type merging (typeMerge = t: null) instead of providing a
  functor-based merge. Add test confirming duplicate declarations fail.
2026-05-24 15:32:04 +02:00
Robert Hensing
8aa6e3dbb9 types.attrListWith: add valueMeta.definitions 2026-05-24 15:32:04 +02:00
Robert Hensing
e29bf2412b lib.modules.mapDefinitionValue: init 2026-05-24 15:32:04 +02:00
yaya
a2e55e31d6 26.11 is Zokor 2026-05-24 15:07:40 +02:00
Robert Hensing
f1b62fdc4e types.attrListWith: add asAttrs
This allows the type's return value to be accessed more easily.

Motivating use case:
- Built-in module provides CLI functionality by declaring
  an `attrListWith { asAttrs = true; }`, extracting the ordered list
  from `valueMeta` for the purpose of creating the `argv`.
- User modules can read the command line's flags directly without
  having to parse the list of attrs.
2026-05-24 15:07:05 +02:00
Robert Hensing
17fdb6f68a types.attrListWith: init
Trivial extraction from attrListOf.
2026-05-24 15:07:05 +02:00
Robert Hensing
43d998e6c0 types.attrListOf: init
This adds a type for name-value mappings that preserve ordering.

Motivating use case: command line flags for package modules /
wrappers / modular services.
The option value can be transformed into a command line in the
correct order.
Additionally, a convenience readOnly option could be provided
to give easy introspection access to the values in an ad hoc
manner.
2026-05-24 15:07:02 +02:00
Eman Resu
e9c2828c5a lib.generators.toGitINI: only recurse into necessary attributes 2026-05-21 18:16:47 -04:00
Eman Resu
ad02f2310f lib.generators.toGitINI: use concatMap to avoid a flatten at the end 2026-05-21 16:17:59 -04:00
Eman Resu
69bb729396 lib.generators.toGitINI: avoid concatenating and mapping on non-lists 2026-05-21 16:15:45 -04:00
Eman Resu
9b4dde7eba lib.generators.toGitINI: move escape logic outside of hot loop 2026-05-21 16:15:45 -04:00
Eman Resu
af62ce4887 lib.generators.toGitINI: avoid creating several variables on every call 2026-05-21 16:15:45 -04:00
Eman Resu
48a99a99fc lib.generators.toGitINI: only define helper variables once 2026-05-21 16:15:24 -04:00
Eman Resu
f23b117e50 lib.showWarnings: inherit lib functions, beta reduce for free 2026-05-21 14:50:51 -04:00
Eman Resu
7f6eb89aeb lib.{importJSON,importTOML}: inherit builtins to global scope 2026-05-21 14:47:07 -04:00
Eman Resu
1f83c2cc22 lib.toBaseDigits: avoid reversing list 2026-05-21 14:41:38 -04:00
Eman Resu
19fcf5006a lib.mirrorFunctionArgs: inline call to setFunctionArgs 2026-05-21 14:41:38 -04:00
adisbladis
8abecec2ab lib.extendMkDerivation: performance cleanups (#522123) 2026-05-21 02:48:31 +00:00
adisbladis
8efcb39ab2 lib.fetchers: minor performance improvements (#522121) 2026-05-21 02:46:56 +00:00
Eman Resu
32a1903229 lib.licenses: inherit lib functions into global scope 2026-05-20 00:32:15 -04:00
Eman Resu
1883329515 lib.licenses: use && for exception licenses
Seems preferable to iterating over a two-element list.
licenseType.exception is only used by lib.licenses.WITH, which I don't
see any usage of in tree - but thought I might as well.
2026-05-20 00:32:15 -04:00
Eman Resu
64e42fb8b1 lib.licenses: add evaluateNamedProperty for quickly checking subattributes 2026-05-20 00:32:14 -04:00
Eman Resu
9e48db8d39 lib.licenses: prevent subcalls for non-simple licenses 2026-05-19 23:02:22 -04:00
Eman Resu
22fcb80812 lib.licenses: only define OR and AND once 2026-05-19 23:02:21 -04:00
Eman Resu
fb84fe6d6f lib.fetchers.withNormalizedHash: share removed attributes for every call 2026-05-19 22:07:17 -04:00
Eman Resu
25118b87ed lib.fetchers.withNormalizedHash: define hashSet before taking fetcher 2026-05-19 22:07:17 -04:00
Eman Resu
35d9631df3 lib.fetchers: share default hash types between functions 2026-05-19 22:07:17 -04:00
Eman Resu
cb3f3435bb lib.fetchers: reuse default hash names between calls 2026-05-19 22:07:17 -04:00
Eman Resu
a64ab557a0 lib.fetchers.normalizeHash: avoid expensive builtins.tail call 2026-05-19 22:07:16 -04:00
Eman Resu
0466dc5b70 lib.fetchers.normalizeHash: remove unnecessary quotes 2026-05-19 22:07:16 -04:00
Eman Resu
e4d668e964 lib.fetchers: inherit commonH lib functions into global scope 2026-05-19 22:07:15 -04:00