mirror of
https://github.com/hercules-ci/flake-parts.git
synced 2025-03-16 21:38:24 +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 {
|
appType = lib.types.submodule {
|
||||||
options = {
|
options = {
|
||||||
type = mkOption {
|
type = mkOption {
|
||||||
type = lib.types.enum ["app"];
|
type = lib.types.enum [ "app" ];
|
||||||
default = "app";
|
default = "app";
|
||||||
description = ''
|
description = ''
|
||||||
A type tag for <literal>apps</literal> consumers.
|
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 = {
|
config = {
|
||||||
flake.apps =
|
flake.apps =
|
||||||
|
@ -71,22 +90,5 @@ in
|
||||||
apps = flake.apps.${system};
|
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…
Add table
Reference in a new issue