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

16 commits

Author SHA1 Message Date
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
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
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
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
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
Robert Hensing
3ee82a16d6 perSystem: functionTo -> deferredModule 2022-05-25 18:18:50 +02:00
Robert Hensing
3beb704537 flake-modules-core -> flake-parts 2022-05-25 16:38:27 +02:00
Robert Hensing
3149d748cb Fix docbook syntax and literalExample deprecation 2022-05-17 10:12:13 +02:00
Robert Hensing
783e29f7dd Add mkPerSystemType, mkPerSystemModule 2022-05-17 10:12:13 +02:00
Robert Hensing
0f58fecd5f Fix getSystem 2022-04-06 18:01:26 +02:00
Robert Hensing
1b82c7f771 Memoize perSystem in allSystems, require devShell 2021-11-22 22:01:38 +01:00
Robert Hensing
f8df47d193 Remove systems default
[] is not a sensible default and the choice is up to the flake
author. I wish it was different.
2021-11-22 16:27:49 +01:00
Robert Hensing
8c3f71965e Small beginnings 2021-10-27 11:05:52 +02:00