From 80d9c0daf35233d48620783817aef0d224e64910 Mon Sep 17 00:00:00 2001 From: Rishik Yalamanchili <73787402+Rishik-Y@users.noreply.github.com> Date: Sun, 19 Jan 2025 15:48:04 +0530 Subject: [PATCH 1/2] netbird: 0.35.2 -> 0.36.3 --- pkgs/tools/networking/netbird/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/networking/netbird/default.nix b/pkgs/tools/networking/netbird/default.nix index 16504673e8e5..5ff99136d655 100644 --- a/pkgs/tools/networking/netbird/default.nix +++ b/pkgs/tools/networking/netbird/default.nix @@ -31,13 +31,13 @@ let in buildGoModule rec { pname = "netbird"; - version = "0.35.2"; + version = "0.36.3"; src = fetchFromGitHub { owner = "netbirdio"; repo = "netbird"; rev = "v${version}"; - hash = "sha256-CvKJiv3CyCRp0wyH+OZejOChcumnMOrA7o9wL4ElJio="; + hash = "sha256-ZAKVjBjffinOyHhzln/ny7tooZwtKHfMEDb/Uy0k6Gw="; }; vendorHash = "sha256-CgfZZOiFDLf6vCbzovpwzt7FlO9BnzNSdR8e5U+xCDQ="; From 8f860dcd1725794be7949019f1f7522c0f5c2f0b Mon Sep 17 00:00:00 2001 From: Rishik Yalamanchili <73787402+Rishik-Y@users.noreply.github.com> Date: Sun, 19 Jan 2025 15:53:11 +0530 Subject: [PATCH 2/2] netbird: fix formatting --- pkgs/tools/networking/netbird/default.nix | 134 ++++++++++++---------- 1 file changed, 74 insertions(+), 60 deletions(-) diff --git a/pkgs/tools/networking/netbird/default.nix b/pkgs/tools/networking/netbird/default.nix index 5ff99136d655..37d867e827d4 100644 --- a/pkgs/tools/networking/netbird/default.nix +++ b/pkgs/tools/networking/netbird/default.nix @@ -1,33 +1,37 @@ -{ stdenv -, lib -, nixosTests -, nix-update-script -, buildGoModule -, fetchFromGitHub -, installShellFiles -, pkg-config -, gtk3 -, libayatana-appindicator -, libX11 -, libXcursor -, libXxf86vm -, Cocoa -, IOKit -, Kernel -, UserNotifications -, WebKit -, ui ? false -, netbird-ui +{ + stdenv, + lib, + nixosTests, + nix-update-script, + buildGoModule, + fetchFromGitHub, + installShellFiles, + pkg-config, + gtk3, + libayatana-appindicator, + libX11, + libXcursor, + libXxf86vm, + Cocoa, + IOKit, + Kernel, + UserNotifications, + WebKit, + ui ? false, + netbird-ui, }: let modules = - if ui then { - "client/ui" = "netbird-ui"; - } else { - client = "netbird"; - management = "netbird-mgmt"; - signal = "netbird-signal"; - }; + if ui then + { + "client/ui" = "netbird-ui"; + } + else + { + client = "netbird"; + management = "netbird-mgmt"; + signal = "netbird-signal"; + }; in buildGoModule rec { pname = "netbird"; @@ -40,23 +44,25 @@ buildGoModule rec { hash = "sha256-ZAKVjBjffinOyHhzln/ny7tooZwtKHfMEDb/Uy0k6Gw="; }; - vendorHash = "sha256-CgfZZOiFDLf6vCbzovpwzt7FlO9BnzNSdR8e5U+xCDQ="; + vendorHash = "sha256-xZz2JkD3yD7tuXVFlMm2g1hRBItkGmO9OvnLdUfqai0="; nativeBuildInputs = [ installShellFiles ] ++ lib.optional ui pkg-config; - buildInputs = lib.optionals (stdenv.hostPlatform.isLinux && ui) [ - gtk3 - libayatana-appindicator - libX11 - libXcursor - libXxf86vm - ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && ui) [ - Cocoa - IOKit - Kernel - UserNotifications - WebKit - ]; + buildInputs = + lib.optionals (stdenv.hostPlatform.isLinux && ui) [ + gtk3 + libayatana-appindicator + libX11 + libXcursor + libXxf86vm + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && ui) [ + Cocoa + IOKit + Kernel + UserNotifications + WebKit + ]; subPackages = lib.attrNames modules; @@ -78,26 +84,31 @@ buildGoModule rec { --replace-fail 'unix:///var/run/netbird.sock' 'unix:///var/run/netbird/sock' ''; - postInstall = lib.concatStringsSep "\n" - (lib.mapAttrsToList - (module: binary: '' - mv $out/bin/${lib.last (lib.splitString "/" module)} $out/bin/${binary} - '' + lib.optionalString (!ui) '' - installShellCompletion --cmd ${binary} \ - --bash <($out/bin/${binary} completion bash) \ - --fish <($out/bin/${binary} completion fish) \ - --zsh <($out/bin/${binary} completion zsh) - '') - modules) + lib.optionalString (stdenv.hostPlatform.isLinux && ui) '' - mkdir -p $out/share/pixmaps - cp $src/client/ui/netbird-systemtray-connected.png $out/share/pixmaps/netbird.png + postInstall = + lib.concatStringsSep "\n" ( + lib.mapAttrsToList ( + module: binary: + '' + mv $out/bin/${lib.last (lib.splitString "/" module)} $out/bin/${binary} + '' + + lib.optionalString (!ui) '' + installShellCompletion --cmd ${binary} \ + --bash <($out/bin/${binary} completion bash) \ + --fish <($out/bin/${binary} completion fish) \ + --zsh <($out/bin/${binary} completion zsh) + '' + ) modules + ) + + lib.optionalString (stdenv.hostPlatform.isLinux && ui) '' + mkdir -p $out/share/pixmaps + cp $src/client/ui/netbird-systemtray-connected.png $out/share/pixmaps/netbird.png - mkdir -p $out/share/applications - cp $src/client/ui/netbird.desktop $out/share/applications/netbird.desktop + mkdir -p $out/share/applications + cp $src/client/ui/netbird.desktop $out/share/applications/netbird.desktop - substituteInPlace $out/share/applications/netbird.desktop \ - --replace-fail "Exec=/usr/bin/netbird-ui" "Exec=$out/bin/netbird-ui" - ''; + substituteInPlace $out/share/applications/netbird.desktop \ + --replace-fail "Exec=/usr/bin/netbird-ui" "Exec=$out/bin/netbird-ui" + ''; passthru = { tests.netbird = nixosTests.netbird; @@ -110,7 +121,10 @@ buildGoModule rec { changelog = "https://github.com/netbirdio/netbird/releases/tag/v${version}"; description = "Connect your devices into a single secure private WireGuard®-based mesh network with SSO/MFA and simple access controls"; license = licenses.bsd3; - maintainers = with maintainers; [ vrifox saturn745 ]; + maintainers = with maintainers; [ + vrifox + saturn745 + ]; mainProgram = "netbird"; }; }