From e91836b9d348f956101ed308c75e09c2a9c26ee3 Mon Sep 17 00:00:00 2001 From: Archit Gupta Date: Thu, 13 Apr 2023 22:57:23 -0700 Subject: [PATCH] Skip conversion of app attributes if they are already apps --- default.nix | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/default.nix b/default.nix index 47024d1..f83cdee 100644 --- a/default.nix +++ b/default.nix @@ -134,13 +134,17 @@ let touch $out ''; - mkApp = lib: program: { - type = "app"; - program = - if lib.isDerivation program - then lib.getExe program - else program; - }; + isApp = x: (x ? type) && (x.type == "app") && (x ? program); + + mkApp = lib: app: + if isApp app then app + else { + type = "app"; + program = + if lib.isDerivation app + then lib.getExe app + else app; + }; eachSystem = fn: foldAttrs mergeAttrs { } (map (system: mapAttrs