From 464b6ecb9bfc2e15c91fa99835250915f6813102 Mon Sep 17 00:00:00 2001 From: zimbatm Date: Sat, 11 Apr 2020 19:29:17 +0200 Subject: [PATCH] add mkApp --- default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/default.nix b/default.nix index 2f4c5d4..c79dea3 100644 --- a/default.nix +++ b/default.nix @@ -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}"; + }; }