mirror of
https://gitlab.com/rensa-nix/core.git
synced 2026-02-01 23:05:08 +01:00
feat: add transformInputs which allows initializing inputs
This commit is contained in:
parent
7222ac48cd
commit
9f20f8c94b
7 changed files with 25 additions and 17 deletions
|
|
@ -10,6 +10,7 @@
|
|||
inputs,
|
||||
cellsFrom,
|
||||
cellBlocks,
|
||||
transformInputs ? system: i: i,
|
||||
systems ? [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
|
|
@ -21,7 +22,7 @@
|
|||
|
||||
loadOutputFor = system: let
|
||||
loadCell = createCellLoader {
|
||||
inherit inputs system cells cellsFrom cellBlocks;
|
||||
inherit inputs system cells cellsFrom cellBlocks transformInputs;
|
||||
};
|
||||
|
||||
cells' = l.mapAttrsToList (cell: type: cell) (l.readDir cellsFrom);
|
||||
|
|
|
|||
|
|
@ -10,8 +10,9 @@
|
|||
inputs,
|
||||
system,
|
||||
cells,
|
||||
transformInputs,
|
||||
}: let
|
||||
importSignatureFor = createImportSignature {inherit inputs;};
|
||||
importSignatureFor = createImportSignature {inherit inputs transformInputs;};
|
||||
|
||||
loadCellBlock = cellName: cellP: cellBlock: let
|
||||
blockP = paths.cellBlockPath cellP cellBlock;
|
||||
|
|
@ -25,8 +26,8 @@
|
|||
then
|
||||
(callFlake (builtins.dirOf cellP.flake) {
|
||||
root = {
|
||||
parent = inputs;
|
||||
system = system;
|
||||
parent = transformInputs system inputs;
|
||||
inherit system;
|
||||
};
|
||||
}).outputs
|
||||
else {};
|
||||
|
|
@ -121,9 +122,10 @@
|
|||
cells,
|
||||
cellsFrom,
|
||||
cellBlocks,
|
||||
transformInputs,
|
||||
}: let
|
||||
inherit (utils) unique accumulate;
|
||||
loadCellBlock = createCellBlockLoader {inherit inputs system cells;};
|
||||
loadCellBlock = createCellBlockLoader {inherit inputs system cells transformInputs;};
|
||||
|
||||
loadCell = cellName: let
|
||||
cellP = paths.cellPath cellsFrom cellName;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
nixpkgs-lib.url = "github:nix-community/nixpkgs.lib";
|
||||
};
|
||||
|
||||
outputs = inputs: import ./. {
|
||||
inherit (inputs.nixpkgs-lib) lib;
|
||||
};
|
||||
outputs = inputs:
|
||||
import ./. {
|
||||
inherit (inputs.nixpkgs-lib) lib;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,12 +22,13 @@
|
|||
rev = cfg.inputs.self.sourceInfo.rev or "not-a-commit";
|
||||
};
|
||||
in {
|
||||
inputs =
|
||||
inputs = cfg.transformInputs system (
|
||||
(deSystemize system (cfg.inputs // additionalInputs))
|
||||
// {
|
||||
inherit self;
|
||||
cells = deSystemize system cells;
|
||||
};
|
||||
}
|
||||
);
|
||||
inherit cell system;
|
||||
};
|
||||
in {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue