Fix: forward meta attributes in flake-parts module

This fixes building machines with the flake-parts module.

Since the inventory merges the machines, the `clan.core.meta` attribute
is now a submodule and conditionally imported.

Also drops the following attributes:
- clan.core.meta.icon
- clan.core.meta.description

In favor of specifying them inside the inventory.

This doesn't use `mkRemovedOptionsModule`, because in our case it would
cause infinite recursion.
This commit is contained in:
a-kenji
2024-08-06 13:05:12 +02:00
committed by kenji
parent 989cf83897
commit 16e6b690ad
5 changed files with 29 additions and 33 deletions

View File

@@ -11,6 +11,7 @@
directory, # The directory containing the machines subdirectory # allows to include machine-specific modules i.e. machines.${name} = { ... }
# A map from arch to pkgs, if specified this nixpkgs will be only imported once for each system.
# This improves performance, but all nipxkgs.* options will be ignored.
# deadnix: skip
inventory ? { },
## Sepcial inputs (not passed to the module system as config)
specialArgs ? { }, # Extra arguments to pass to nixosSystem i.e. useful to make self available # A set containing clan meta: name :: string, icon :: string, description :: string
@@ -27,14 +28,9 @@ let
;
self = directory;
};
meta = attrs.meta or { };
rest = builtins.removeAttrs attrs [
"meta"
"specialArgs"
];
rest = builtins.removeAttrs attrs [ "specialArgs" ];
in
eval {
inventory.meta = lib.mapAttrs (_: lib.mkDefault) meta;
imports = [
rest
# implementation