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.
40 lines
1.1 KiB
Nix
40 lines
1.1 KiB
Nix
## WARNING: Do not add core logic here.
|
|
## This is only a wrapper such that buildClan can be called as a function.
|
|
## Add any logic to ./module.nix
|
|
{
|
|
lib,
|
|
nixpkgs,
|
|
clan-core,
|
|
}:
|
|
{
|
|
## Inputs
|
|
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
|
|
##
|
|
...
|
|
}@attrs:
|
|
let
|
|
eval = import ./eval.nix {
|
|
inherit
|
|
lib
|
|
nixpkgs
|
|
specialArgs
|
|
clan-core
|
|
;
|
|
self = directory;
|
|
};
|
|
rest = builtins.removeAttrs attrs [ "specialArgs" ];
|
|
in
|
|
eval {
|
|
imports = [
|
|
rest
|
|
# implementation
|
|
./module.nix
|
|
];
|
|
}
|