10 , libayatana-appindicator
25 "client/ui" = "netbird-ui";
28 management = "netbird-mgmt";
29 signal = "netbird-signal";
36 src = fetchFromGitHub {
40 hash = "sha256-DWtTCx+vzOE4yE9jAUxB1oF1UubIXK4f7wptJY89az0=";
43 vendorHash = "sha256-LPq6ovulE+xdoRaQpwA0mNqw3kFxMs/am1ucO8UmDtU=";
45 nativeBuildInputs = [ installShellFiles ] ++ lib.optional ui pkg-config;
47 buildInputs = lib.optionals (stdenv.isLinux && ui) [
49 libayatana-appindicator
53 ] ++ lib.optionals (stdenv.isDarwin && ui) [
61 subPackages = lib.attrNames modules;
66 "-X github.com/netbirdio/netbird/version.version=${version}"
70 # needs network access
74 # make it compatible with systemd's RuntimeDirectory
75 substituteInPlace client/cmd/root.go \
76 --replace-fail 'unix:///var/run/netbird.sock' 'unix:///var/run/netbird/sock'
77 substituteInPlace client/ui/client_ui.go \
78 --replace-fail 'unix:///var/run/netbird.sock' 'unix:///var/run/netbird/sock'
81 postInstall = lib.concatStringsSep "\n"
84 mv $out/bin/${lib.last (lib.splitString "/" module)} $out/bin/${binary}
85 '' + lib.optionalString (!ui) ''
86 installShellCompletion --cmd ${binary} \
87 --bash <($out/bin/${binary} completion bash) \
88 --fish <($out/bin/${binary} completion fish) \
89 --zsh <($out/bin/${binary} completion zsh)
91 modules) + lib.optionalString (stdenv.isLinux && ui) ''
92 mkdir -p $out/share/pixmaps
93 cp $src/client/ui/netbird-systemtray-connected.png $out/share/pixmaps/netbird.png
95 mkdir -p $out/share/applications
96 cp $src/client/ui/netbird.desktop $out/share/applications/netbird.desktop
98 substituteInPlace $out/share/applications/netbird.desktop \
99 --replace-fail "Exec=/usr/bin/netbird-ui" "Exec=$out/bin/netbird-ui"
103 tests.netbird = nixosTests.netbird;
104 tests.netbird-ui = netbird-ui;
105 updateScript = nix-update-script { };
109 homepage = "https://netbird.io";
110 changelog = "https://github.com/netbirdio/netbird/releases/tag/v${version}";
111 description = "Connect your devices into a single secure private WireGuard®-based mesh network with SSO/MFA and simple access controls";
112 license = licenses.bsd3;
113 maintainers = with maintainers; [ misuzu ];
114 mainProgram = "netbird";