feat(lib/buildClan): turn lib/build-clan into a 'buildClanModule' with sub-features such as 'buildClan' and 'flakePartsModule'
This commit is contained in:
@@ -9,6 +9,8 @@ clan-core:
|
|||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (lib) types;
|
inherit (lib) types;
|
||||||
|
|
||||||
|
buildClanModule = clan-core.clanLib.buildClanModule;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -20,8 +22,7 @@ in
|
|||||||
inherit (inputs) nixpkgs;
|
inherit (inputs) nixpkgs;
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
../lib/build-clan/interface.nix
|
buildClanModule.flakePartsModule
|
||||||
../lib/build-clan/module.nix
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,6 +6,24 @@
|
|||||||
nixpkgs,
|
nixpkgs,
|
||||||
clan-core,
|
clan-core,
|
||||||
}:
|
}:
|
||||||
|
let
|
||||||
|
clanResultAttributes = [
|
||||||
|
"clanInternals"
|
||||||
|
"nixosConfigurations"
|
||||||
|
];
|
||||||
|
in
|
||||||
|
{
|
||||||
|
inherit clanResultAttributes;
|
||||||
|
flakePartsModule = {
|
||||||
|
imports = [
|
||||||
|
./interface.nix
|
||||||
|
./module.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
Function that returns the same result as the correlated flake-parts module
|
||||||
|
*/
|
||||||
|
buildClan =
|
||||||
{
|
{
|
||||||
## Inputs
|
## Inputs
|
||||||
self ? lib.warn "Argument: 'self' must be set when using 'buildClan'." null, # Reference to the current flake
|
self ? lib.warn "Argument: 'self' must be set when using 'buildClan'." null, # Reference to the current flake
|
||||||
@@ -29,7 +47,6 @@ let
|
|||||||
;
|
;
|
||||||
inherit specialArgs;
|
inherit specialArgs;
|
||||||
};
|
};
|
||||||
|
|
||||||
rest = builtins.removeAttrs attrs [ "specialArgs" ];
|
rest = builtins.removeAttrs attrs [ "specialArgs" ];
|
||||||
in
|
in
|
||||||
eval {
|
eval {
|
||||||
@@ -38,4 +55,5 @@ eval {
|
|||||||
# implementation
|
# implementation
|
||||||
./module.nix
|
./module.nix
|
||||||
];
|
];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,10 +20,12 @@ lib.fix (clanLib: {
|
|||||||
clan-core = self;
|
clan-core = self;
|
||||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||||
};
|
};
|
||||||
buildClan = import ./build-clan {
|
|
||||||
|
buildClanModule = import ./build-clan {
|
||||||
inherit lib nixpkgs;
|
inherit lib nixpkgs;
|
||||||
clan-core = self;
|
clan-core = self;
|
||||||
};
|
};
|
||||||
|
buildClan = clanLib.buildClanModule.buildClan;
|
||||||
# ------------------------------------
|
# ------------------------------------
|
||||||
# Lib functions that don't depend on 'self'
|
# Lib functions that don't depend on 'self'
|
||||||
inventory = clanLib.callLib ./inventory { };
|
inventory = clanLib.callLib ./inventory { };
|
||||||
|
|||||||
Reference in New Issue
Block a user