Merge pull request #209 from hercules-ci/getexe

Getexe
This commit is contained in:
Robert Hensing 2024-01-29 19:03:35 +01:00 committed by GitHub
commit bffc4be17f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 33 additions and 10 deletions

View file

@ -14,11 +14,18 @@ rec {
inherit (f-p-lib) mkFlake;
inherit (f-p.inputs.nixpkgs-lib) lib;
pkg = system: name: derivation {
name = name;
builder = "no-builder";
system = system;
};
pkg = system: name:
derivation
{
name = name;
builder = "no-builder";
system = system;
}
// {
meta = {
mainProgram = name;
};
};
empty = mkFlake
{ inputs.self = { }; }
@ -46,8 +53,9 @@ rec {
{ inputs.self = { }; }
{
systems = [ "a" "b" ];
perSystem = { system, ... }: {
perSystem = { config, system, ... }: {
packages.hello = pkg system "hello";
apps.hello.program = config.packages.hello;
};
};
@ -142,7 +150,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 = { };