Commit 34584623 authored by jaredmontoya's avatar jaredmontoya
Browse files

wg-access-server: use finalAttrs

parent 563e6f1c
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -8,14 +8,14 @@
  nixosTests,
}:

buildGoModule rec {
buildGoModule (finalAttrs: {
  pname = "wg-access-server";
  version = "0.12.1";

  src = fetchFromGitHub {
    owner = "freifunkMUC";
    repo = "wg-access-server";
    rev = "v${version}";
    rev = "v${finalAttrs.version}";
    hash = "sha256-AhFqEmHrx9MCdjnB/YA3qU7KsaMyLO+vo53VWUrcL8I=";
  };

@@ -34,12 +34,12 @@ buildGoModule rec {
  checkFlags = [ "-skip=TestDNSProxy_ServeDNS" ];

  ui = buildNpmPackage {
    inherit version src;
    inherit (finalAttrs) version src;
    pname = "wg-access-server-ui";

    npmDepsHash = "sha256-04AkSDSKsr20Jbx5BJy36f8kWNlzzplu/xnoDTkU8OQ=";

    sourceRoot = "${src.name}/website";
    sourceRoot = "${finalAttrs.src.name}/website";

    installPhase = ''
      mv build $out
@@ -48,11 +48,11 @@ buildGoModule rec {

  postPatch = ''
    substituteInPlace internal/services/website_router.go \
        --replace-fail 'website/build' "${ui}"
        --replace-fail 'website/build' "${finalAttrs.ui}"
  '';

  preBuild = ''
    VERSION=v${version} go generate buildinfo/buildinfo.go
    VERSION=v${finalAttrs.version} go generate buildinfo/buildinfo.go
  '';

  postInstall = ''
@@ -72,4 +72,4 @@ buildGoModule rec {
    maintainers = with lib.maintainers; [ xanderio ];
    mainProgram = "wg-access-server";
  };
}
})