mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-29 11:36:16 +01:00
3c40bda301
Signed-off-by: magic_rb <magic_rb@redalder.org>
47 lines
812 B
Nix
47 lines
812 B
Nix
{
|
|
inputs,
|
|
lib,
|
|
...
|
|
}: let
|
|
inherit
|
|
(lib)
|
|
pipe
|
|
mapAttrs'
|
|
mapAttrs
|
|
filterAttrs
|
|
callPackageWith
|
|
hasSuffix
|
|
removeSuffix
|
|
nameValuePair
|
|
;
|
|
in {
|
|
perSystem = {
|
|
system,
|
|
pkgs,
|
|
...
|
|
}: let
|
|
importDefault = path:
|
|
import path {
|
|
inherit
|
|
lib
|
|
inputs
|
|
system
|
|
pkgs
|
|
;
|
|
};
|
|
in {
|
|
checks = pipe (builtins.readDir ./.) [
|
|
(filterAttrs (n: _: n != "default.nix"))
|
|
(mapAttrs' (n: v: let
|
|
newName =
|
|
if hasSuffix ".nix" n
|
|
then removeSuffix ".nix" n
|
|
else n;
|
|
in
|
|
nameValuePair newName v))
|
|
(mapAttrs (n: _: (importDefault (toString ./. + "/" + n))))
|
|
(filterAttrs (_: v: v ? "_type" -> v._type == "if" -> v.condition))
|
|
];
|
|
};
|
|
}
|