chore(lib/select): move into subfolder with a test file
This commit is contained in:
@@ -29,6 +29,6 @@ lib.fix (clanLib: {
|
|||||||
modules = clanLib.callLib ./inventory/frontmatter { };
|
modules = clanLib.callLib ./inventory/frontmatter { };
|
||||||
values = import ./introspection { inherit lib; };
|
values = import ./introspection { inherit lib; };
|
||||||
jsonschema = import ./jsonschema { inherit lib; };
|
jsonschema = import ./jsonschema { inherit lib; };
|
||||||
select = import ./select.nix;
|
select = import select/default.nix;
|
||||||
facts = import ./facts.nix { inherit lib; };
|
facts = import ./facts.nix { inherit lib; };
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -8,9 +8,10 @@ rec {
|
|||||||
# TODO: automatically generate this from the directory conventions
|
# TODO: automatically generate this from the directory conventions
|
||||||
imports = [
|
imports = [
|
||||||
./build-clan/flake-module.nix
|
./build-clan/flake-module.nix
|
||||||
|
./introspection/flake-module.nix
|
||||||
./inventory/flake-module.nix
|
./inventory/flake-module.nix
|
||||||
./jsonschema/flake-module.nix
|
./jsonschema/flake-module.nix
|
||||||
./introspection/flake-module.nix
|
./select/flake-module.nix
|
||||||
];
|
];
|
||||||
flake.clanLib = import ./default.nix {
|
flake.clanLib = import ./default.nix {
|
||||||
inherit lib inputs self;
|
inherit lib inputs self;
|
||||||
|
|||||||
44
lib/select/flake-module.nix
Normal file
44
lib/select/flake-module.nix
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
{ self, inputs, ... }:
|
||||||
|
let
|
||||||
|
inputOverrides = builtins.concatStringsSep " " (
|
||||||
|
builtins.map (input: " --override-input ${input} ${inputs.${input}}") (builtins.attrNames inputs)
|
||||||
|
);
|
||||||
|
in
|
||||||
|
{
|
||||||
|
perSystem =
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
system,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
# Run: nix-unit --extra-experimental-features flakes --flake .#legacyPackages.x86_64-linux.evalTests
|
||||||
|
legacyPackages.evalTests-select = import ./tests.nix {
|
||||||
|
inherit lib;
|
||||||
|
inherit (self) clanLib;
|
||||||
|
};
|
||||||
|
|
||||||
|
checks = {
|
||||||
|
lib-select-eval = pkgs.runCommand "tests" { nativeBuildInputs = [ pkgs.nix-unit ]; } ''
|
||||||
|
export HOME="$(realpath .)"
|
||||||
|
export NIX_ABORT_ON_WARN=1
|
||||||
|
nix-unit --eval-store "$HOME" \
|
||||||
|
--extra-experimental-features flakes \
|
||||||
|
${inputOverrides} \
|
||||||
|
--flake ${
|
||||||
|
self.filter {
|
||||||
|
include = [
|
||||||
|
"flakeModules"
|
||||||
|
"lib"
|
||||||
|
"clanModules/flake-module.nix"
|
||||||
|
"clanModules/borgbackup"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}#legacyPackages.${system}.evalTests-select
|
||||||
|
|
||||||
|
touch $out
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
4
lib/select/tests.nix
Normal file
4
lib/select/tests.nix
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{ clanLib }:
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user