From fac55aa3ba5846239d4aa4ae84cd19a8718188af Mon Sep 17 00:00:00 2001 From: James LaChance Date: Sun, 31 May 2026 07:43:54 -0400 Subject: [PATCH] fosrl-pangolin: Allow edition to be specified Currently the only way to override which "set" is installed is by replacing strings in the buildPhase with overrideAttrs. This way seems a bit cleaner, certainly easier and more obvious. --- pkgs/by-name/fo/fosrl-pangolin/package.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/fo/fosrl-pangolin/package.nix b/pkgs/by-name/fo/fosrl-pangolin/package.nix index 8b380d6e2aa2..6b7d04c64d3e 100644 --- a/pkgs/by-name/fo/fosrl-pangolin/package.nix +++ b/pkgs/by-name/fo/fosrl-pangolin/package.nix @@ -6,6 +6,7 @@ makeWrapper, formats, databaseType ? "sqlite", + edition ? "oss", environmentVariables ? { }, nixosTests, }: @@ -15,6 +16,12 @@ assert lib.assertOneOf "databaseType" databaseType [ "pg" ]; +assert lib.assertOneOf "edition" edition [ + "enterprise" + "oss" + "saas" +]; + let db = isLong: @@ -57,7 +64,7 @@ buildNpmPackage (finalAttrs: { preBuild = '' npm run set:${db false} - npm run set:oss + npm run set:${edition} npm run db:generate ''; @@ -160,7 +167,7 @@ buildNpmPackage (finalAttrs: { description = "Tunneled reverse proxy server with identity and access control"; homepage = "https://github.com/fosrl/pangolin"; changelog = "https://github.com/fosrl/pangolin/releases/tag/${finalAttrs.version}"; - license = lib.licenses.agpl3Only; + license = [ lib.licenses.agpl3Only ] ++ lib.optional (edition != "oss") lib.licenses.unfree; maintainers = with lib.maintainers; [ jackr water-sucks