1
0
Fork 0
mirror of https://github.com/hercules-ci/flake-parts.git synced 2024-12-14 11:47:31 +00:00

apps: Use mkTransposedPerSystemModule

This commit is contained in:
Shea Levy 2022-10-30 06:53:32 -04:00
parent 8e6bca1b0a
commit 40b344843d
No known key found for this signature in database
GPG key ID: 5C0BD6957D86FE27

View file

@ -1,15 +1,11 @@
{ config, lib, flake-parts-lib, ... }: { config, lib, flake-parts-lib, ... }:
let let
inherit (lib) inherit (lib)
filterAttrs
mapAttrs
mkOption mkOption
optionalAttrs
types types
; ;
inherit (flake-parts-lib) inherit (flake-parts-lib)
mkSubmoduleOptions mkTransposedPerSystemModule
mkPerSystemOption
; ;
programType = lib.types.coercedTo derivationType getExe lib.types.str; programType = lib.types.coercedTo derivationType getExe lib.types.str;
@ -44,27 +40,9 @@ let
}; };
}; };
in in
{ mkTransposedPerSystemModule {
options = { name = "apps";
flake = mkSubmoduleOptions { option = mkOption {
apps = mkOption {
type = types.lazyAttrsOf (types.lazyAttrsOf appType);
default = { };
description = ''
Programs runnable with nix run <literal>.#&lt;name></literal>.
'';
example = lib.literalExpression or lib.literalExample ''
{
x86_64-linux.default.program = "''${config.packages.hello}/bin/hello";
}
'';
};
};
perSystem = mkPerSystemOption
({ config, system, ... }: {
options = {
apps = mkOption {
type = types.lazyAttrsOf appType; type = types.lazyAttrsOf appType;
default = { }; default = { };
description = '' description = ''
@ -76,11 +54,5 @@ in
} }
''; '';
}; };
}; file = ./apps.nix;
});
};
config = {
transposition.apps = { };
};
} }