mirror of
https://github.com/donovanglover/nix-config.git
synced 2025-02-11 07:19:30 +01:00
flake: use listFilesRecursive for tests
This commit is contained in:
parent
c8adf93d0b
commit
bb65333491
29
flake.nix
29
flake.nix
@ -34,7 +34,8 @@
|
|||||||
...
|
...
|
||||||
}@attrs:
|
}@attrs:
|
||||||
let
|
let
|
||||||
inherit (nixpkgs.lib) nixosSystem packagesFromDirectoryRecursive;
|
inherit (nixpkgs.lib) nixosSystem;
|
||||||
|
inherit (nixpkgs.lib.filesystem) packagesFromDirectoryRecursive listFilesRecursive;
|
||||||
inherit (nixpkgs.legacyPackages) x86_64-linux aarch64-linux;
|
inherit (nixpkgs.legacyPackages) x86_64-linux aarch64-linux;
|
||||||
|
|
||||||
inherit (builtins)
|
inherit (builtins)
|
||||||
@ -49,14 +50,12 @@
|
|||||||
"overlays"
|
"overlays"
|
||||||
"nixosModules"
|
"nixosModules"
|
||||||
"homeModules"
|
"homeModules"
|
||||||
"checks"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
flakeDirectories = [
|
flakeDirectories = [
|
||||||
"overlays"
|
"overlays"
|
||||||
"modules"
|
"modules"
|
||||||
"home"
|
"home"
|
||||||
"tests"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
forAllSystems = function:
|
forAllSystems = function:
|
||||||
@ -71,6 +70,15 @@
|
|||||||
directory = ./packages;
|
directory = ./packages;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
checks.x86_64-linux = listToAttrs (map (file: {
|
||||||
|
name = replaceStrings [ ".nix" ] [ "" ] (baseNameOf (toString file));
|
||||||
|
|
||||||
|
value = import file {
|
||||||
|
inherit self;
|
||||||
|
pkgs = x86_64-linux;
|
||||||
|
};
|
||||||
|
}) (listFilesRecursive ./tests));
|
||||||
|
|
||||||
nixosConfigurations =
|
nixosConfigurations =
|
||||||
let
|
let
|
||||||
phoneModules = [
|
phoneModules = [
|
||||||
@ -139,22 +147,11 @@
|
|||||||
attributeValue = listToAttrs (
|
attributeValue = listToAttrs (
|
||||||
map (file: {
|
map (file: {
|
||||||
name = replaceStrings [ ".nix" ] [ "" ] file;
|
name = replaceStrings [ ".nix" ] [ "" ] file;
|
||||||
value =
|
value = import ./${directory}/${file};
|
||||||
if directory == "tests" then
|
|
||||||
import ./${directory}/${file} {
|
|
||||||
inherit self;
|
|
||||||
pkgs = x86_64-linux;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
import ./${directory}/${file};
|
|
||||||
}) (attrNames (readDir ./${directory}))
|
}) (attrNames (readDir ./${directory}))
|
||||||
);
|
);
|
||||||
|
|
||||||
attributeSet =
|
attributeSet = attributeValue;
|
||||||
if directory == "tests" then
|
|
||||||
{ x86_64-linux = attributeValue; }
|
|
||||||
else
|
|
||||||
attributeValue;
|
|
||||||
in
|
in
|
||||||
attributeSet;
|
attributeSet;
|
||||||
}) flakeOutputs
|
}) flakeOutputs
|
||||||
|
Loading…
Reference in New Issue
Block a user