base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12
[NixPkgs.git] / pkgs / by-name / hy / hyprspace / package.nix
blob0dfc28e9b4767aeec3e8d7e4154f003e209f3d91
2   lib,
3   buildGoModule,
4   fetchFromGitHub,
5   writeShellScript,
6   nix-update,
7   nix,
8 }:
10 buildGoModule rec {
11   pname = "hyprspace";
12   version = "0.10.2";
14   src = fetchFromGitHub {
15     owner = "hyprspace";
16     repo = "hyprspace";
17     rev = "refs/tags/v${version}";
18     hash = "sha256-zWajCfHFqPa3Z72DHcxBUq4bmcCu1lpEKUbZZewpYOE=";
19   };
21   CGO_ENABLED = "0";
23   vendorHash = "sha256-LJpgGeD47Bs+Cq9Z7WWFa49F8/n3exOyxRcd6EkkL2g=";
25   ldflags = [
26     "-s"
27     "-w"
28     "-X github.com/hyprspace/hyprspace/cli.appVersion=${version}"
29   ];
31   preBuild = ''
32     ln -s ${./config_generated.go} ./schema/config_generated.go
33   '';
35   passthru.updateScript = writeShellScript "update" ''
36     ${lib.getExe nix-update} hyprspace
37     nix () {
38       ${lib.getExe nix} --extra-experimental-features 'flakes nix-command' "$@"
39     }
40     cat "$(
41       nix build --print-out-paths --no-link \
42       "github:hyprspace/hyprspace?ref=refs/tags/v$(
43         nix eval .#hyprspace.version --raw
44        )#vendor"
45       )/schema/config_generated.go" \
46     > pkgs/by-name/hy/hyprspace/config_generated.go
47   '';
49   meta = {
50     description = "Lightweight VPN Built on top of Libp2p for Truly Distributed Networks";
51     homepage = "https://github.com/hyprspace/hyprspace";
52     license = lib.licenses.asl20;
53     maintainers = with lib.maintainers; [
54       gerg-l
55       max
56     ];
57     platforms = lib.platforms.linux;
58     mainProgram = "hyprspace";
59   };