1
0
Fork 0
mirror of https://github.com/numtide/flake-utils.git synced 2024-12-14 11:47:31 +00:00
Commit graph

102 commits

Author SHA1 Message Date
Jonas Chevalier
11707dc2f6
README: add new logo (#120) 2024-11-13 22:27:16 +01:00
Jonas Chevalier
c1dfcf0841
Merge pull request #119 from trueNAHO/lib-each-default-system-pass-through-each-system-pass-through-init 2024-09-17 10:14:13 +02:00
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
NAHO
988e455b6f
readme: remove trailing whitespaces 2024-09-11 22:39:44 +02:00
dependabot[bot]
b1d9ab7066
Bump cachix/install-nix-action from 25 to 26 (#116)
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 25 to 26.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v25...v26)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-11 09:33:50 +01:00
Mason Mackaman
d465f48194
Add the current system if --impure is used (#115) 2024-02-28 14:18:44 +01:00
Shahar "Dawn" Or
1ef2e671c3
Update README.md (#111) 2024-01-15 10:00:34 +01:00
dependabot[bot]
c8eb208c25
Bump cachix/install-nix-action from 24 to 25 (#113)
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 24 to 25.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v24...v25)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-15 09:23:02 +01:00
dependabot[bot]
4022d587cb
Bump cachix/install-nix-action from 23 to 24 (#109)
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 23 to 24.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v23...v24)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-04 09:58:27 +01:00
dependabot[bot]
ff7b65b44d
Bump cachix/install-nix-action from 22 to 23 (#106)
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 22 to 23.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v22...v23)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-12 16:33:58 +02:00
dependabot[bot]
286e744c96
Bump actions/checkout from 3 to 4 (#105)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-12 16:33:20 +02: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
zimbatm
1721b3e7c8 README: add light commercial support offer 2023-08-23 14:03:34 +02:00
Julien Malka
919d646de7
Fix typo in ReadMe (#95) 2023-07-11 11:46:48 +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
dependabot[bot]
abfb11bd1a
Bump cachix/install-nix-action from 21 to 22 (#100)
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 21 to 22.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v21...v22)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-19 12:41:11 +02:00
Jean-Baptiste Giraudeau
180473db90
Add test to ensure no special handling of hydraJobs 2023-05-31 17:24:45 +02:00
Hamish Mackenzie
9e0a97e026
No special treatment for hydraJobs 2023-05-31 16:56:20 +02:00
dependabot[bot]
a1720a10a6
Bump cachix/install-nix-action from 20 to 21 (#96)
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 20 to 21.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v20...v21)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-31 09:35:50 +02:00
zimbatm
cfacdce06f
REAMDE: document the systems pattern a bit more 2023-04-11 10:47:17 +02:00
zimbatm
033b9f258c
clean flake check warnings 2023-04-09 12:49:34 +02:00
zimbatm
2f02e38dfa
update allSystems.nix
Updated from nixpkgs fd531dee22c9a3d4336cc2da39e8dd905e8f3de4
2023-04-09 12:47:01 +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
Julian Antonielli
13faa43c34
Use less confusing syntax (#85) 2023-04-09 12:30:52 +02:00
Wesley Nelson
946da79176
Update documentation for the systems argument of simpleFlake (#92) 2023-04-08 11:39:05 +02:00
dependabot[bot]
411e876415
Bump cachix/install-nix-action from 19 to 20 (#89)
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 19 to 20.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v19...v20)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-06 12:21:09 +02:00
Abin Simon
93a2b84fc4
Update README to reflect example for eachDefaultSystem (#90)
packages.default instead of defaultPackage. Same for apps.
2023-03-15 18:33:47 +01:00
dependabot[bot]
3db36a8b46
Bump cachix/install-nix-action from 18 to 19 (#87)
* Bump cachix/install-nix-action from 18 to 19

Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 18 to 19.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v18...v19)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update nix.yml

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jonas Chevalier <zimbatm@zimbatm.com>
2023-02-13 11:16:34 +01:00
Domen Kožar
5aed5285a9
remove 20 years old arch (#82) 2022-11-02 14:33:13 +01:00
dependabot[bot]
6ee9ebb6b1
Bump cachix/install-nix-action from 17 to 18 (#81)
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 17 to 18.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v17...v18)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-29 23:01:28 +02:00
Luc Perkins
c0e246b9b8
Update each-system template to use new flake output system (#76) 2022-08-07 15:12:55 +02:00
oxalica
7e2a3b3dfd
check-utils: use the same success derivation (#75)
A successful check doesn't need reporting, so we use the same derivation
to reduce building jobs.
2022-07-04 12:00:14 +02:00
Jonas Chevalier
bee6a7250d
Merge pull request #74 from sigprof/filter-packages
Fix `filterPackages` to match platform filtering done by Nixpkgs
2022-06-24 12:05:34 +02:00
Sergey Vlasov
32dc3d46b2 filterPackages: Fix a typo in the comment 2022-06-24 00:32:04 +03:00
Sergey Vlasov
3b6a41d794 filterPackages: Do not use meta.hydraPlatforms for filtering
The meta.hydraPlatforms attribute was never intended to mark the package
broken; actually lots of packages have `meta.hydraPlatforms = []` while
being perfectly usable.  Typical reasons for disabling Hydra builds are:

  - the package build process is so trivial that caching the build
    results on Hydra won't be useful (this often applies to wrapper
    packages, or some packages which contain just prebuilt data or
    binaries);

  - the package build process exceeds Hydra limits;

  - the package is impure and depends on some proprietary software
    installed on the build host (this is the case with some
    Darwin-specific packages that require Xcode to build);

  - the package license does not allow redistribution of binaries (which
    also may need to be modified to work with Nix, and many proprietary
    licenses don't allow redistribution of such modified binaries);
    although this should normally be handled with meta.unfree.

Especially the first case (wrapper packages) hits some important
packages (firefox, neovim).

Remove the usage of meta.hydraPlatforms from the filterPackages code, so
that the filtering performed by that function would match the actual
platform restriction of packages (meta.platforms and meta.badPlatforms).
2022-06-24 00:07:55 +03:00
Sergey Vlasov
3ff4550a66 filterPackages: Add support for meta.badPlatforms
Since https://www.github.com/NixOS/nixpkgs/pull/37803 Nixpkgs supports
using meta.badPlatforms to specify a list of platforms which are not
supported by the package despite being included in meta.platforms.
Modify filterPackages to honor these platform restrictions.
2022-06-24 00:01:45 +03:00
Markus Hauck
1ed9fb1935
Fix check-utils template directory name (#70) 2022-05-30 08:55:45 +02:00
Gabriel Fontes
04c1b18086
feat: add convenience eachDefaultSystemMap (#60) 2022-05-17 10:27:56 +02:00
Jörg Thalheim
a97445c4fc
expose examples as templates (#63) 2022-05-17 09:58:38 +02:00
Hazel Weakly
04b4d989fd
Sanitize the final derivation name to ensure length limits are respected (#66) 2022-05-16 22:32:57 +02:00
Jörg Thalheim
12806d31a3
Merge pull request #64 from numtide/all-systems
Update all systems list
2022-05-14 20:41:17 +01:00
Jörg Thalheim
86115ca06b
allSystems: sync with nixpkgs 2022-05-14 21:40:07 +02:00