diff options
author | Morgan Helton <mhelton@gmail.com> | 2022-09-05 14:28:23 -0500 |
---|---|---|
committer | Morgan Helton <mhelton@gmail.com> | 2022-09-05 14:28:23 -0500 |
commit | 0b16c98205c02df91ab72d687a66927f34e3a7aa (patch) | |
tree | 57834d9cd47385ce21cf3ff4efd77e28b325d1bb /pkgs/servers/http | |
parent | 2ded6702dcccfdf9c42d0cefa1fb2e15fd0e0676 (diff) |
pomerium: consolidate ui and base package
Diffstat (limited to 'pkgs/servers/http')
-rw-r--r-- | pkgs/servers/http/pomerium/common.nix | 25 | ||||
-rw-r--r-- | pkgs/servers/http/pomerium/default.nix | 50 | ||||
-rw-r--r-- | pkgs/servers/http/pomerium/ui.nix | 38 |
3 files changed, 46 insertions, 67 deletions
diff --git a/pkgs/servers/http/pomerium/common.nix b/pkgs/servers/http/pomerium/common.nix deleted file mode 100644 index 24071eb5044d4..0000000000000 --- a/pkgs/servers/http/pomerium/common.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ fetchFromGitHub -, lib -}: - -{ - version = "0.19.0"; - srcSha256 = "sha256:0s5ji1iywymzxlv89y3ivl5vngkifhbpidpwxdrh969l3c5r4klf"; - vendorSha256 = "sha256:1p78nb7bryvs7p5iq6ihylflyjia60x4hd9c62ffwz37dwqlbi33"; - yarnSha256 = "sha256:1n6swanrds9hbd4yyfjzpnfhsb8fzj1pwvvcg3w7b1cgnihclrmv"; - - src = fetchFromGitHub { - owner = "pomerium"; - repo = "pomerium"; - rev = "v${version}"; - sha256 = srcSha256; - }; - - meta = with lib; { - homepage = "https://pomerium.io"; - description = "Authenticating reverse proxy"; - license = licenses.asl20; - maintainers = with maintainers; [ lukegb ]; - platforms = [ "x86_64-linux" "aarch64-linux" ]; - }; -} diff --git a/pkgs/servers/http/pomerium/default.nix b/pkgs/servers/http/pomerium/default.nix index 31f9a7e59e0ce..42af2054caf28 100644 --- a/pkgs/servers/http/pomerium/default.nix +++ b/pkgs/servers/http/pomerium/default.nix @@ -3,18 +3,52 @@ , callPackage , lib , envoy +, mkYarnPackage +, fetchYarnDeps , nixosTests -, pomerium-ui , pomerium-cli }: let inherit (lib) concatStringsSep concatMap id mapAttrsToList; - common = callPackage ./common.nix { }; in buildGoModule rec { - inherit (common) version src vendorSha256 meta; pname = "pomerium"; + version = "0.19.0"; + src = fetchFromGitHub { + owner = "pomerium"; + repo = "pomerium"; + rev = "v${version}"; + sha256 = "sha256:0s5ji1iywymzxlv89y3ivl5vngkifhbpidpwxdrh969l3c5r4klf"; + }; + + vendorSha256 = "sha256:1p78nb7bryvs7p5iq6ihylflyjia60x4hd9c62ffwz37dwqlbi33"; + + ui = mkYarnPackage { + inherit version; + src = "${src}/ui"; + + # update pomerium-ui-package.json when updating package, sourced from ui/package.json + packageJSON = ./pomerium-ui-package.json; + offlineCache = fetchYarnDeps { + yarnLock = "${src}/ui/yarn.lock"; + sha256 = "sha256:1n6swanrds9hbd4yyfjzpnfhsb8fzj1pwvvcg3w7b1cgnihclrmv"; + }; + + buildPhase = '' + runHook preBuild + yarn --offline build + runHook postbuild + ''; + + installPhase = '' + runHook preInstall + cp -R deps/pomerium/dist $out + runHook postInstall + ''; + + doDist = false; + }; subPackages = [ "cmd/pomerium" @@ -70,7 +104,7 @@ buildGoModule rec { echo '${envoy.version}' > pkg/envoy/files/envoy.version # put the built UI files where they will be picked up as part of binary build - cp -r ${pomerium-ui} ui + cp -r ${ui}/* ui/dist ''; installPhase = '' @@ -81,4 +115,12 @@ buildGoModule rec { inherit (nixosTests) pomerium; inherit pomerium-cli; }; + + meta = with lib; { + homepage = "https://pomerium.io"; + description = "Authenticating reverse proxy"; + license = licenses.asl20; + maintainers = with maintainers; [ lukegb ]; + platforms = [ "x86_64-linux" "aarch64-linux" ]; + }; } diff --git a/pkgs/servers/http/pomerium/ui.nix b/pkgs/servers/http/pomerium/ui.nix deleted file mode 100644 index f2a94814ca215..0000000000000 --- a/pkgs/servers/http/pomerium/ui.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ lib -, callPackage -, fetchFromGitHub -, fetchYarnDeps -, mkYarnPackage }: -let - common = callPackage ./common.nix { }; -in -mkYarnPackage { - inherit (common) version; - pname = "pomerium-ui"; - src = "${common.src}/ui"; - - # update pomerium-ui-package.json when updating package, sourced from ui/package.json - packageJSON = ./pomerium-ui-package.json; - offlineCache = fetchYarnDeps { - yarnLock = "${common.src}/ui/yarn.lock"; - sha256 = common.yarnSha256; - }; - - buildPhase = '' - runHook preBuild - yarn --offline build - runHook postbuild - ''; - - installPhase = '' - runHook preInstall - cp -R deps/pomerium/dist $out - runHook postInstall - ''; - - doDist = false; - - meta = common.meta // { - description = "Pomerium authenticating reverse proxy UI"; - }; -} |