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

83 commits

Author SHA1 Message Date
Yang, Bo
9c92fd1582
Set proper type for flake.nixosModules 2024-09-12 01:09:17 -07:00
Shivaraj B H
358ab8370e
reference to Nix manual
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2024-08-17 17:48:49 +05:30
Shivaraj B H
309636f1b0
correct typo
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2024-08-17 17:48:00 +05:30
shivaraj-bh
4a41226e75 apps: Add meta option
This allows specifying metadata info about the flake app. This has been
standardized in Nix at https://github.com/NixOS/nix/pull/11297
2024-08-17 16:58:53 +05:30
Robert Hensing
411e5ab0e8 Add class: imports "type checking"
Initially this had some feature checking with lib.functionArgs, but
I don't think this is useful. The _class attribute is not supported
by long-unsupported Nixpkgs (<23.05) anyway, so let's keep it simple.
2024-05-16 15:09:50 +02:00
Robert Hensing
bffc4be17f
Merge pull request #209 from hercules-ci/getexe
Getexe
2024-01-29 19:03:35 +01:00
Robert Hensing
238b0dc94b apps: Add polyfill 2024-01-29 18:57:52 +01:00
Robert Hensing
528a7d0cb9 transposition: Explain incomplete usage of transposition
Abort because this is a clear programming error, that should never
be caught.
2024-01-11 12:59:37 +01:00
Robert Hensing
3a0408e3ac perSystem: Check that inputs'.<name> is a flake, for better error message
The alternative would have been to try and make this not an evaluation error,
but that would cause problems.

Idea: use filterAttrs to construct an attrset "inputFlakes". This would be
bad because it requires that we evaluate all inputs, just to see whether
they're flakes or not.

If Nix were to provide this metadata independently, which it could do
very efficiently, we still ought to wonder what's the purpose of
eliding those attributes. The only ways you'll encounter this
exception in `inputs'.<broken>` is by either
 - making a mistake, in which case the error message is great
 - or traversing all inputs, which nobody should do.

See https://flake.parts/best-practices-for-module-writing#do-not-traverse-inputs

Other idea: return *something empty*. This avoids the strictness
problem above, but still optimizes for the wrong use case.

Ultimately though, attribute transposition should not be needed at all,
but this project is largely dependent on the implicit schema imposed by Nix.
2024-01-11 12:46:03 +01:00
Robert Hensing
ac5d0b2d4d transposition: Improve perInput error message 2024-01-11 12:17:33 +01:00
DavHau
7de0c651b7 raise error when flake attribute doesn't exist
Currently when trying to access packages from input flakes for a system that isn't supported by that flake, the error is not very conclusive.
It costed me at least an hour to grasp this. Now putting in this error message to prevent others from falling into the same trap.
2023-12-10 20:07:51 +07:00
Robert Hensing
25abf6caa8
Merge pull request #192 from hercules-ci/moduleLocation
moduleLocation, but also automatic
2023-10-29 12:23:28 +01:00
Robert Hensing
9551c1dbc1 transposition: Improve doc 2023-10-03 16:09:54 +02:00
Patrick Jackson
acd542d16b apps: use lib.getExe to find executable 2023-07-31 08:56:50 -07:00
Yang, Bo
f359432597
Merge branch 'main' into moduleLocation 2023-07-22 18:07:20 -07:00
Santiago Fraire
6f53e9012c docs: update to comments 2023-06-30 09:31:36 +02:00
Santiago Fraire
93292ab70a docs: add example for devShells 2023-06-22 22:15:57 +02:00
Robert Hensing
80717d1161
Merge pull request #163 from figsoda/unused
remove unused code
2023-05-30 16:30:39 +02:00
figsoda
40ee120dcc remove unused code 2023-05-29 13:52:03 -04:00
figsoda
942a008e28 perInput: Make the default lazier 2023-05-29 13:39:48 -04:00
Yang, Bo
1e8a89e5f8 Add moduleLocation to mkFlake argument
tmp
2023-05-09 09:53:22 -07:00
Robert Hensing
f5b6209441 flakeModules: Support disabledModules
Requires Nixpkgs > 2023-03-09
2023-03-09 17:24:06 +01:00
Robert Hensing
1a49a78b71 doc: Fix nixosModules link fragment 2023-01-26 23:10:40 +01:00
Robert Hensing
0ba773370f doc: improve nixosConfigurations description and example 2023-01-26 20:37:49 +01:00
Robert Hensing
08ba869d7c perInput: Improve description 2023-01-07 00:23:33 +01:00
Robert Hensing
319ee04044 easyOverlay: fix
The tests only caught this for the non-memoized system case.
2023-01-05 01:16:03 +01:00
Robert Hensing
9ca2803752 easyOverlay: Remove performance warning which is not relevant 2023-01-05 01:07:58 +01:00
Robert Hensing
2565b6d4a3 doc: debug: Add link to debug page 2022-12-27 14:05:15 +01:00
bors[bot]
8bfe94414f
Merge #61
61: Add option for defining flake-parts modules for downstream flakes. r=roberth a=shlevy



Co-authored-by: Shea Levy <shea@shealevy.com>
2022-12-27 12:46:02 +00:00
Robert Hensing
a765ceb02c perSystem: Add custom error messages for learning about top level module args
Example:

```
error: `self` (without `'`) is not a `perSystem` module argument, but a
       module argument  of the top level config.

       The following is an example usage of `self`. Note that its binding
       is in the `top` parameter list, which is declared by the top level module
       rather than the `perSystem` module.

         top@{ config, lib, self, ... }: {
           perSystem = { config, self', ... }: {
             # in scope here:
             #  - self
             #  - self'
             #  - config (of perSystem)
             #  - top.config (note the `top@` pattern)
           };
         }
```
2022-12-27 12:59:03 +01:00
Shea Levy
f3c79bef3b
Add option for defining flake-parts modules for downstream flakes. 2022-12-25 06:30:44 -05:00
Robert Hensing
7bb0781d08 Add debug module 2022-12-20 18:07:16 +01:00
Robert Hensing
85518a2916 Remove darwinModules
It should be added to the nix-darwin project instead.
2022-11-27 16:21:59 +00:00
Robert Hensing
4944a920d2 formatter: Use markdown 2022-11-13 11:51:28 +01:00
Robert Hensing
a78bfeaa86 Revert "formatter: Use mkTransposedPerSystemModule"
This reverts commit e7da962abb.
2022-11-13 11:50:16 +01:00
Robert Hensing
d8f05073ae Remove redundant lib.mdDoc 2022-11-11 07:41:10 +01:00
Robert Hensing
6b87695050 Use markdown by default 2022-11-11 07:41:08 +01:00
Shea Levy
96c27dbba0
packages: Use mkTransposedPerSystemModule 2022-11-10 14:06:56 -05:00
Shea Levy
1e5e56e476
legacyPackages: Use mkTransposedPerSystemModule 2022-11-10 14:06:33 -05:00
Shea Levy
e7da962abb
formatter: Use mkTransposedPerSystemModule 2022-11-10 14:06:11 -05:00
Shea Levy
5e259eb312
devShells: Use mkTransposedPerSystemModule 2022-11-10 14:05:51 -05:00
Shea Levy
5bcff37bc1
checks: Use mkTransposedPerSystemModule 2022-11-10 14:05:14 -05:00
Shea Levy
40b344843d
apps: Use mkTransposedPerSystemModule 2022-11-10 14:04:40 -05:00
Robert Hensing
0c8eff7513 Add transposition.<name>.adHoc 2022-10-26 14:07:24 +02:00
Robert Hensing
6269836424 Generalize transposed attributes 2022-10-26 14:06:02 +02:00
Robert Hensing
79b42f0842 Remove dead code
The module system guarantees presence of these attrs.
2022-10-26 12:34:16 +02:00
Robert Hensing
e511bc4812 Remove redundant null filters 2022-09-28 19:13:41 +02:00
Jonas Chevalier
d6fdbbca37
Update modules/formatter.nix
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2022-09-20 15:53:52 +02:00
Jonas Chevalier
09bc19757c
Update modules/formatter.nix
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2022-09-20 15:53:47 +02:00
zimbatm
41ba43a33d
add formatter schema
This is needed for flakes that want to support `nix fmt`
2022-09-19 16:59:51 +02:00