1
0
Fork 0
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:
Robert Hensing 2024-01-29 18:57:10 +01:00
parent acd542d16b
commit 562a6b5e54

View file

@ -14,11 +14,18 @@ rec {
inherit (f-p-lib) mkFlake; inherit (f-p-lib) mkFlake;
inherit (f-p.inputs.nixpkgs-lib) lib; inherit (f-p.inputs.nixpkgs-lib) lib;
pkg = system: name: derivation { pkg = system: name:
name = name; derivation
builder = "no-builder"; {
system = system; name = name;
}; builder = "no-builder";
system = system;
}
// {
meta = {
mainProgram = name;
};
};
empty = mkFlake empty = mkFlake
{ inputs.self = { }; } { inputs.self = { }; }
@ -30,8 +37,9 @@ rec {
{ inputs.self = { }; } { inputs.self = { }; }
{ {
systems = [ "a" "b" ]; systems = [ "a" "b" ];
perSystem = { system, ... }: { perSystem = { config, system, ... }: {
packages.hello = pkg system "hello"; packages.hello = pkg system "hello";
apps.hello.program = config.packages.hello;
}; };
}; };
@ -126,7 +134,20 @@ rec {
}; };
assert example1 == { 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 = { }; }; checks = { a = { }; b = { }; };
devShells = { a = { }; b = { }; }; devShells = { a = { }; b = { }; };
formatter = { }; formatter = { };