diff options
author | misuzu <bakalolka@gmail.com> | 2023-04-20 13:33:04 +0300 |
---|---|---|
committer | misuzu <bakalolka@gmail.com> | 2023-04-20 13:33:04 +0300 |
commit | 9df4441b52279528fe73c7e73a7e8ca45fe65a9d (patch) | |
tree | 779bca8a1218785c801ec8867249897209b3f617 /pkgs/tools/networking/netbird/default.nix | |
parent | cafa2f02fbbcade5c5c257c190061da555d90913 (diff) |
netbird: format using nixpkgs-fmt
Diffstat (limited to 'pkgs/tools/networking/netbird/default.nix')
-rw-r--r-- | pkgs/tools/networking/netbird/default.nix | 72 |
1 files changed, 44 insertions, 28 deletions
diff --git a/pkgs/tools/networking/netbird/default.nix b/pkgs/tools/networking/netbird/default.nix index 0323c8e6f8550..eaa905939c060 100644 --- a/pkgs/tools/networking/netbird/default.nix +++ b/pkgs/tools/networking/netbird/default.nix @@ -1,16 +1,31 @@ -{ stdenv, lib, nixosTests, buildGoModule, fetchFromGitHub, installShellFiles +{ stdenv +, lib +, nixosTests +, 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 { - "client/ui" = "netbird-ui"; - } else { - client = "netbird"; - management = "netbird-mgmt"; - signal = "netbird-signal"; - }; + modules = + if ui then { + "client/ui" = "netbird-ui"; + } else { + client = "netbird"; + management = "netbird-mgmt"; + signal = "netbird-signal"; + }; in buildGoModule rec { pname = "netbird"; @@ -61,25 +76,26 @@ buildGoModule rec { --replace '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.isLinux && ui) '' - mkdir -p $out/share/pixmaps - cp $src/client/ui/disconnected.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.isLinux && ui) '' + mkdir -p $out/share/pixmaps + cp $src/client/ui/disconnected.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 "Exec=/usr/bin/netbird-ui" "Exec=$out/bin/netbird-ui" - ''; + substituteInPlace $out/share/applications/netbird.desktop \ + --replace "Exec=/usr/bin/netbird-ui" "Exec=$out/bin/netbird-ui" + ''; passthru.tests.netbird = nixosTests.netbird; |