2024-09-19 14:19:46 +00:00
|
|
|
{ lib, stdenv, buildGo123Module, tailscale }:
|
2024-01-02 11:29:13 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
buildGo123Module {
|
2024-01-02 11:29:13 +00:00
|
|
|
pname = "tailscale-nginx-auth";
|
2024-07-27 06:49:29 +00:00
|
|
|
inherit (tailscale) version src vendorHash;
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
CGO_ENABLED = 0;
|
|
|
|
|
|
|
|
subPackages = [ "cmd/nginx-auth" ];
|
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-w"
|
|
|
|
"-s"
|
2024-07-27 06:49:29 +00:00
|
|
|
"-X tailscale.com/version.longStamp=${tailscale.version}"
|
|
|
|
"-X tailscale.com/version.shortStamp=${tailscale.version}"
|
2024-01-02 11:29:13 +00:00
|
|
|
];
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
|
2024-01-02 11:29:13 +00:00
|
|
|
mv $out/bin/nginx-auth $out/bin/tailscale.nginx-auth
|
|
|
|
sed -i -e "s#/usr/sbin#$out/bin#" ./cmd/nginx-auth/tailscale.nginx-auth.service
|
|
|
|
install -D -m0444 -t $out/lib/systemd/system ./cmd/nginx-auth/tailscale.nginx-auth.service
|
|
|
|
install -D -m0444 -t $out/lib/systemd/system ./cmd/nginx-auth/tailscale.nginx-auth.socket
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://tailscale.com";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Tool that allows users to use Tailscale Whois authentication with NGINX as a reverse proxy";
|
2024-01-02 11:29:13 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
mainProgram = "tailscale.nginx-auth";
|
2024-05-15 15:35:15 +00:00
|
|
|
maintainers = with maintainers; [ phaer ];
|
2024-01-02 11:29:13 +00:00
|
|
|
};
|
|
|
|
}
|