example refactor snowflake module system
This commit is contained in:
parent
0314109bc0
commit
3e29615db9
26 changed files with 1306 additions and 165 deletions
38
nix/snow/flake/default.nix
Normal file
38
nix/snow/flake/default.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
this,
|
||||
inputs,
|
||||
systems,
|
||||
...
|
||||
}: let
|
||||
inherit (inputs.nixpkgs) lib;
|
||||
in {
|
||||
# snow.flake
|
||||
flake = flakeInputs: root: let
|
||||
snowflake = lib.evalModules {
|
||||
class = "snowflake";
|
||||
# XXX: TODO: abort if inputs contains reserved names
|
||||
specialArgs =
|
||||
(flakeInputs
|
||||
// {
|
||||
inherit (this) snow;
|
||||
inherit systems root;
|
||||
inputs = flakeInputs;
|
||||
})
|
||||
# XXX: TODO:
|
||||
# |> (x: builtins.removeAttrs x ["self" "nodes"]);
|
||||
|> (x: builtins.removeAttrs x ["self"]);
|
||||
|
||||
modules = [
|
||||
./module.nix
|
||||
({config, ...}: {
|
||||
_module.args = {
|
||||
self = config;
|
||||
# XXX: TODO:
|
||||
# nodes = config.nodes.nodes;
|
||||
};
|
||||
})
|
||||
];
|
||||
};
|
||||
in
|
||||
snowflake.config.outputs;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue