mirror of
https://github.com/hercules-ci/flake-parts.git
synced 2024-12-14 11:47:31 +00:00
dev: Test apps
This commit is contained in:
parent
acd542d16b
commit
562a6b5e54
1 changed files with 28 additions and 7 deletions
|
@ -14,10 +14,17 @@ rec {
|
|||
inherit (f-p-lib) mkFlake;
|
||||
inherit (f-p.inputs.nixpkgs-lib) lib;
|
||||
|
||||
pkg = system: name: derivation {
|
||||
pkg = system: name:
|
||||
derivation
|
||||
{
|
||||
name = name;
|
||||
builder = "no-builder";
|
||||
system = system;
|
||||
}
|
||||
// {
|
||||
meta = {
|
||||
mainProgram = name;
|
||||
};
|
||||
};
|
||||
|
||||
empty = mkFlake
|
||||
|
@ -30,8 +37,9 @@ rec {
|
|||
{ inputs.self = { }; }
|
||||
{
|
||||
systems = [ "a" "b" ];
|
||||
perSystem = { system, ... }: {
|
||||
perSystem = { config, system, ... }: {
|
||||
packages.hello = pkg system "hello";
|
||||
apps.hello.program = config.packages.hello;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -126,7 +134,20 @@ rec {
|
|||
};
|
||||
|
||||
assert example1 == {
|
||||
apps = { a = { }; b = { }; };
|
||||
apps = {
|
||||
a = {
|
||||
hello = {
|
||||
program = "${pkg "a" "hello"}/bin/hello";
|
||||
type = "app";
|
||||
};
|
||||
};
|
||||
b = {
|
||||
hello = {
|
||||
program = "${pkg "b" "hello"}/bin/hello";
|
||||
type = "app";
|
||||
};
|
||||
};
|
||||
};
|
||||
checks = { a = { }; b = { }; };
|
||||
devShells = { a = { }; b = { }; };
|
||||
formatter = { };
|
||||
|
|
Loading…
Reference in a new issue