pomerium: consolidate ui and base package

This commit is contained in:
Morgan Helton 2022-09-05 14:28:23 -05:00
parent 2ded6702dc
commit 0b16c98205
4 changed files with 47 additions and 70 deletions

View file

@ -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" ];
};
}

View file

@ -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" ];
};
}

View file

@ -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";
};
}

View file

@ -22892,9 +22892,7 @@ with pkgs;
};
pflogsumm = callPackage ../servers/mail/postfix/pflogsumm.nix { };
pomerium = callPackage ../servers/http/pomerium {
pomerium-ui = callPackage ../servers/http/pomerium/ui.nix { };
};
pomerium = callPackage ../servers/http/pomerium { };
pomerium-cli = callPackage ../tools/security/pomerium-cli { };
postgrey = callPackage ../servers/mail/postgrey { };