mirror of
https://github.com/hercules-ci/flake-parts.git
synced 2024-12-14 11:47:31 +00:00
Move perSystem.apps into options
This commit is contained in:
parent
4835e05925
commit
ef93e89462
1 changed files with 22 additions and 20 deletions
|
@ -25,7 +25,7 @@ let
|
|||
appType = lib.types.submodule {
|
||||
options = {
|
||||
type = mkOption {
|
||||
type = lib.types.enum ["app"];
|
||||
type = lib.types.enum [ "app" ];
|
||||
default = "app";
|
||||
description = ''
|
||||
A type tag for <literal>apps</literal> consumers.
|
||||
|
@ -56,6 +56,25 @@ in
|
|||
'';
|
||||
};
|
||||
};
|
||||
|
||||
perSystem = mkPerSystemOption
|
||||
({ config, system, ... }: {
|
||||
options = {
|
||||
apps = mkOption {
|
||||
type = types.lazyAttrsOf appType;
|
||||
default = { };
|
||||
description = ''
|
||||
Programs runnable with nix run <literal>.#<name></literal>.
|
||||
'';
|
||||
example = lib.literalExpression or lib.literalExample ''
|
||||
{
|
||||
default.program = "''${config.packages.hello}/bin/hello";
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
};
|
||||
config = {
|
||||
flake.apps =
|
||||
|
@ -71,22 +90,5 @@ in
|
|||
apps = flake.apps.${system};
|
||||
};
|
||||
|
||||
perSystem = system: { config, ... }: {
|
||||
_file = ./apps.nix;
|
||||
options = {
|
||||
apps = mkOption {
|
||||
type = types.lazyAttrsOf appType;
|
||||
default = { };
|
||||
description = ''
|
||||
Programs runnable with nix run <literal>.#<name></literal>.
|
||||
'';
|
||||
example = lib.literalExpression or lib.literalExample ''
|
||||
{
|
||||
default.program = "''${config.packages.hello}/bin/hello";
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue