Unverified Commit 515da5b6 authored by Nick Cao's avatar Nick Cao Committed by GitHub
Browse files

Merge pull request #227243 from misuzu/netbird-update

netbird: 0.14.6 -> 0.16.0
parents c6e39d87 d5bb5259
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -41,9 +41,10 @@ in {
      documentation = [ "https://netbird.io/docs/" ];
      after = [ "network.target" ];
      wantedBy = [ "multi-user.target" ];
      path = with pkgs; [
        openresolv
      ];
      serviceConfig = {
        AmbientCapabilities = [ "CAP_NET_ADMIN" ];
        DynamicUser = true;
        Environment = [
          "NB_CONFIG=/var/lib/netbird/config.json"
          "NB_LOG_FILE=console"
+53 −33
Original line number Diff line number Diff line
{ stdenv, lib, nixosTests, buildGoModule, fetchFromGitHub, installShellFiles
{ stdenv
, lib
, nixosTests
, nix-update-script
, buildGoModule
, fetchFromGitHub
, installShellFiles
, pkg-config
, gtk3, libayatana-appindicator, libX11, libXcursor, libXxf86vm
, Cocoa, IOKit, Kernel, UserNotifications, WebKit
, ui ? false }:
, gtk3
, libayatana-appindicator
, libX11
, libXcursor
, libXxf86vm
, Cocoa
, IOKit
, Kernel
, UserNotifications
, WebKit
, ui ? false
}:
let
  modules = if ui then {
  modules =
    if ui then {
      "client/ui" = "netbird-ui";
    } else {
      client = "netbird";
@@ -14,16 +30,16 @@ let
in
buildGoModule rec {
  pname = "netbird";
  version = "0.14.6";
  version = "0.16.0";

  src = fetchFromGitHub {
    owner = "netbirdio";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-S11PshEVwOYPb8RGs5joC3Cr8CNKAenK6JRd/oV4LNQ=";
    sha256 = "sha256-HtkMwy+8Af69vOz9VYMozOzW/W7CFSXlWR0vLlmYCeY=";
  };

  vendorHash = "sha256-RyTfEZPwr2CNb9M8vGmo4gtbqQDh2KWApyz2Yx6qPmk=";
  vendorHash = "sha256-lag/usfAvpZhWeVe1wB3SJJsTCLcBeh04RvkE803OqQ=";

  nativeBuildInputs = [ installShellFiles ] ++ lib.optional ui pkg-config;

@@ -46,7 +62,7 @@ buildGoModule rec {
  ldflags = [
    "-s"
    "-w"
    "-X github.com/netbirdio/netbird/client/system.version=${version}"
    "-X github.com/netbirdio/netbird/version.version=${version}"
    "-X main.builtBy=nix"
  ];

@@ -61,7 +77,8 @@ buildGoModule rec {
      --replace 'unix:///var/run/netbird.sock' 'unix:///var/run/netbird/sock'
  '';

  postInstall = lib.concatStringsSep "\n" (lib.mapAttrsToList
  postInstall = lib.concatStringsSep "\n"
    (lib.mapAttrsToList
      (module: binary: ''
        mv $out/bin/${lib.last (lib.splitString "/" module)} $out/bin/${binary}
      '' + lib.optionalString (!ui) ''
@@ -81,7 +98,10 @@ buildGoModule rec {
      --replace "Exec=/usr/bin/netbird-ui" "Exec=$out/bin/netbird-ui"
  '';

  passthru.tests.netbird = nixosTests.netbird;
  passthru = {
    tests.netbird = nixosTests.netbird;
    updateScript = nix-update-script { };
  };

  meta = with lib; {
    homepage = "https://netbird.io";