From 690e5486429033199b43a928543f56ee2399d4d2 Mon Sep 17 00:00:00 2001 From: Lucas Desgouilles Date: Thu, 23 Jun 2022 03:03:48 +0200 Subject: [PATCH] Skip getExe when `app..program` is a string --- modules/apps.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/apps.nix b/modules/apps.nix index c932ddd..d3fbc07 100644 --- a/modules/apps.nix +++ b/modules/apps.nix @@ -12,7 +12,11 @@ let mkPerSystemOption ; - programType = lib.types.coercedTo lib.types.package getExe lib.types.str; + programType = lib.types.coercedTo derivationType getExe lib.types.str; + + derivationType = lib.types.package // { + check = lib.isDerivation; + }; getExe = x: "${lib.getBin x}/bin/${x.meta.mainProgram or (throw ''Package ${x.name or ""} does not have meta.mainProgram set, so I don't know how to find the main executable. You can set meta.mainProgram, or pass the full path to executable, e.g. program = "''${pkg}/bin/foo"'')}";