1
0
Fork 0
mirror of https://github.com/numtide/flake-utils.git synced 2025-03-15 04:58:05 +00:00
Commit graph

14 commits

Author SHA1 Message Date
NAHO
fa06cc1b3d
lib: eachDefaultSystemPassThrough/eachSystemPassThrough: init
Expose the eachDefaultSystemPassThrough and eachSystemPassThrough
functions to handle cases where the system key should not be injected by
eachDefaultSystem and eachSystem:

    inputs.flake-utils.lib.eachDefaultSystem (system: {
      checks./*<SYSTEM>.*/"<CHECK>" = /* ... */;
      devShells./*<SYSTEM>.*/"<DEV_SHELL>" = /* ... */;
      packages./*<SYSTEM>.*/"<PACKAGE>" = /* ... */;
    })
    // inputs.flake-utils.lib.eachDefaultSystemPassThrough (system: {
      homeConfigurations."<HOME_CONFIGURATION>" = /* ... */;
      nixosConfigurations."<NIXOS_CONFIGURATION>" = /* ... */;
    })

These functions prevent users from re-implementing simplified
eachDefaultSystem and eachSystem versions to avoid system key
injections, while benefiting from current and future complex logic, like
handling the '--impure' flag.

This addresses flake-utils' arguably biggest issue. [1]

[1]: https://ayats.org/blog/no-flake-utils
2024-09-16 22:56:16 +02:00
NAHO
58351e4428
lib: eachSystem: optimize hot path by assuming rare --impure usage 2024-09-16 15:34:27 +02:00
NAHO
db82e07bd4
lib: eachSystem: simplify boolean expression
Simplify boolean expression to reduce nesting and improve performance.
2024-09-16 15:34:27 +02:00
NAHO
ce5c962a8c
lib: eachSystem: inline single-use local variables
Inline single-use local variables to minimize cognitive load while
reading the code, unless they cache computational results.
2024-09-16 15:34:27 +02:00
NAHO
274ed073aa
lib: eachSystem: improve comments 2024-09-16 15:34:27 +02:00
NAHO
e8a5a7ba21
lib: eachSystem: reformat using 'nixfmt-rfc-style --width 80'
Reformatting the eachSystem function using 'nixfmt-rfc-style --width 80'
avoids formatting arguments in the following commits.
2024-09-16 15:34:27 +02:00
NAHO
b1606d7d73
lib: lib: sort inherit statements 2024-09-16 15:34:27 +02:00
Mason Mackaman
d465f48194
Add the current system if --impure is used (#115) 2024-02-28 14:18:44 +01:00
Jonas Chevalier
f9e7cf8183
Merge pull request #97 from input-output-hk/jbgi/revert-hydraJobs
Revert special handling of hydraJobs
2023-08-23 16:11:51 +02:00
Javed Mohamed
dbabf0ca0c
Add meld (#99)
Meld allows you to break up a Nix Flake into parts while using the
same inputs across all of them.  This is useful for splitting up large
flakes which are common in monorepos.
2023-06-25 18:15:56 +02:00
Hamish Mackenzie
9e0a97e026
No special treatment for hydraJobs 2023-05-31 16:56:20 +02:00
zimbatm
575419ad23
split out allSystems.nix
Make it easier to maintain
2023-04-09 12:45:31 +02:00
zimbatm
471aed544a
fixup! introduce externally extensible systems (#93)
re-expose defaultSystems even if it doesn't make a lot of sense anymore,
to not break back-compat.
2023-04-09 12:39:36 +02:00
Jonas Chevalier
1c226cc8c6
introduce externally extensible systems (#93)
This PR is a back-compatible subset of #84.

By adding a new flake input here, it makes it possible to override the
list of systems using flake overrides.

See <https://github.com/nix-systems/nix-systems> for the full
explanation.
2023-04-09 12:34:52 +02:00