add mkApp

This commit is contained in:
zimbatm 2020-04-11 19:29:17 +02:00
parent f6ee9d535f
commit 464b6ecb9b
No known key found for this signature in database
GPG Key ID: 71BAF6D40C1D63D7
1 changed files with 11 additions and 0 deletions

View File

@ -23,4 +23,15 @@ rec {
# > x86_64-linux = null; }
# (system -> attrs) -> attrs
forAllSupported = genAttrs supportedSystems;
# Returns the structure used by `nix app`
mkApp =
{ drv
, name ? drv.pname or drv.name
, exePath ? drv.passthru.exePath or "/bin/${name}"
}:
{
type = "app";
program = "${drv}${exePath}";
};
}