1{
2 lib,
3 buildGoModule,
4 fetchFromGitHub,
5 makeWrapper,
6 nixosTests,
7 nix-update-script,
8}:
9
10buildGoModule {
11 pname = "echoip";
12 version = "0-unstable-2023-05-21";
13
14 src = fetchFromGitHub {
15 owner = "mpolden";
16 repo = "echoip";
17 rev = "d84665c26cf7df612061e9c35abe325ba9d86b8d";
18 hash = "sha256-7qc1NZu0hC1np/EKf5fU5Cnd7ikC1+tIrYOXhxK/++Y=";
19 };
20
21 vendorHash = "sha256-lXYpkeGpBK+WGHqyLxJz7kS3t7a55q55QQLTqtxzroc=";
22
23 nativeBuildInputs = [ makeWrapper ];
24
25 postInstall = ''
26 install -D html/* -t $out/share/echoip/html
27 wrapProgram $out/bin/echoip \
28 --add-flags "-t $out/share/echoip/html"
29 '';
30
31 passthru = {
32 tests = { inherit (nixosTests) echoip; };
33 updateScript = nix-update-script { extraArgs = [ "--version=branch" ]; };
34 };
35
36 meta = {
37 description = "IP address lookup service";
38 homepage = "https://github.com/mpolden/echoip";
39 license = lib.licenses.bsd3;
40 maintainers = with lib.maintainers; [
41 rvolosatovs
42 SuperSandro2000
43 defelo
44 ];
45 mainProgram = "echoip";
46 };
47}