netbird: 0.35.2 -> 0.36.3 (#375002)
This commit is contained in:
@@ -1,62 +1,68 @@
|
||||
{ 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";
|
||||
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=";
|
||||
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";
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user