2023-03-03 12:08:06 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
2024-03-17 15:36:02 +00:00
|
|
|
, nodejs
|
|
|
|
, npmHooks
|
|
|
|
, fetchNpmDeps
|
2023-03-03 12:08:06 +00:00
|
|
|
, nix-update-script
|
|
|
|
}:
|
2021-10-07 03:05:05 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "godns";
|
2024-08-12 16:59:40 +00:00
|
|
|
version = "3.1.8";
|
2021-10-07 03:05:05 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "TimothyYe";
|
|
|
|
repo = "godns";
|
2023-03-03 12:08:06 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-08-12 16:59:40 +00:00
|
|
|
hash = "sha256-a8qa8dlFn0+mE2SeDJPZ0OI4EkA/GGFYxkNQE5yKjvM=";
|
2021-10-07 03:05:05 +00:00
|
|
|
};
|
|
|
|
|
2024-08-12 16:59:40 +00:00
|
|
|
vendorHash = "sha256-ui7GiLR5um8TGrVS+MCXzop1tkeysxBYFrD2Fh0tnBI=";
|
2024-03-17 15:36:02 +00:00
|
|
|
npmDeps = fetchNpmDeps {
|
|
|
|
src = "${src}/web";
|
2024-08-12 16:59:40 +00:00
|
|
|
hash = "sha256-oPE69+R66r1LpryAu3ImKKRVDrzXAiDpeCwdQKRmVj0=";
|
2024-03-17 15:36:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
npmRoot = "web";
|
|
|
|
nativeBuildInputs = [
|
|
|
|
nodejs
|
|
|
|
npmHooks.npmConfigHook
|
|
|
|
];
|
|
|
|
|
|
|
|
overrideModAttrs = oldAttrs: {
|
|
|
|
# Do not add `npmConfigHook` to `goModules`
|
|
|
|
nativeBuildInputs = lib.remove npmHooks.npmConfigHook oldAttrs.nativeBuildInputs;
|
|
|
|
# Do not run `preBuild` when building `goModules`
|
|
|
|
preBuild = null;
|
|
|
|
};
|
2021-10-07 03:05:05 +00:00
|
|
|
|
|
|
|
# Some tests require internet access, broken in sandbox
|
|
|
|
doCheck = false;
|
|
|
|
|
2024-03-17 15:36:02 +00:00
|
|
|
preBuild = ''
|
|
|
|
npm --prefix="$npmRoot" run build
|
|
|
|
go generate ./...
|
|
|
|
'';
|
|
|
|
|
2023-03-03 12:08:06 +00:00
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X main.Version=${version}"
|
|
|
|
];
|
2021-10-07 03:05:05 +00:00
|
|
|
|
2022-12-25 22:11:14 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
2022-05-11 04:24:27 +00:00
|
|
|
|
2021-10-07 03:05:05 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Dynamic DNS client tool supports AliDNS, Cloudflare, Google Domains, DNSPod, HE.net & DuckDNS & DreamHost, etc";
|
|
|
|
homepage = "https://github.com/TimothyYe/godns";
|
2023-03-03 12:06:34 +00:00
|
|
|
changelog = "https://github.com/TimothyYe/godns/releases/tag/v${version}";
|
2021-10-07 03:05:05 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ yinfeng ];
|
2024-02-11 02:19:15 +00:00
|
|
|
mainProgram = "godns";
|
2021-10-07 03:05:05 +00:00
|
|
|
};
|
|
|
|
}
|