mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
wg-access-server: init at 0.12.1
This commit is contained in:
parent
88af533d8a
commit
28106064d7
66
pkgs/by-name/wg/wg-access-server/package.nix
Normal file
66
pkgs/by-name/wg/wg-access-server/package.nix
Normal file
@ -0,0 +1,66 @@
|
||||
{ lib
|
||||
, buildGoModule
|
||||
, buildNpmPackage
|
||||
, fetchFromGitHub
|
||||
, makeWrapper
|
||||
, iptables
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "wg-access-server";
|
||||
version = "0.12.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "freifunkMUC";
|
||||
repo = "wg-access-server";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-AhFqEmHrx9MCdjnB/YA3qU7KsaMyLO+vo53VWUrcL8I=";
|
||||
};
|
||||
|
||||
proxyVendor = true; # darwin/linux hash mismatch
|
||||
vendorHash = "sha256-YwFq0KxUctU3ElZBo/b68pyp4lJnFGL9ClKIwUzdngM=";
|
||||
|
||||
CGO_ENABLED = 1;
|
||||
|
||||
ldflags = [ "-s" "-w" ];
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
checkFlags = [ "-skip=TestDNSProxy_ServeDNS" ];
|
||||
|
||||
ui = buildNpmPackage {
|
||||
inherit version src;
|
||||
pname = "wg-access-server-ui";
|
||||
|
||||
npmDepsHash = "sha256-04AkSDSKsr20Jbx5BJy36f8kWNlzzplu/xnoDTkU8OQ=";
|
||||
|
||||
sourceRoot = "${src.name}/website";
|
||||
|
||||
installPhase = ''
|
||||
mv build $out
|
||||
'';
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace internal/services/website_router.go \
|
||||
--replace-fail 'website/build' "${ui}"
|
||||
'';
|
||||
|
||||
preBuild = ''
|
||||
VERSION=v${version} go generate buildinfo/buildinfo.go
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $out/
|
||||
wrapProgram $out/bin/wg-access-server \
|
||||
--prefix PATH : ${lib.makeBinPath [ iptables ]}
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "An all-in-one WireGuard VPN solution with a web ui for connecting devices";
|
||||
homepage = "https://github.com/freifunkMUC/wg-access-server";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ xanderio ];
|
||||
mainProgram = "wg-access-server";
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user