16 src = fetchFromGitHub {
20 hash = "sha256-BFkf+Gdej/AsIL89obHEwchrw4IcZqjEkr/suYKbVKY=";
23 vendorHash = "sha256-8OsUAknSuSJH1rRxMf8EVTUuIDHsIJauVI7hB4Fk1KU=";
43 nativeBuildInputs = [ installShellFiles ];
46 "-X=github.com/sagernet/sing-box/constant.Version=${version}"
49 postInstall = let emulator = stdenv.hostPlatform.emulator buildPackages; in ''
50 installShellCompletion --cmd sing-box \
51 --bash <(${emulator} $out/bin/sing-box completion bash) \
52 --fish <(${emulator} $out/bin/sing-box completion fish) \
53 --zsh <(${emulator} $out/bin/sing-box completion zsh )
55 substituteInPlace release/config/sing-box{,@}.service \
56 --replace-fail "/usr/bin/sing-box" "$out/bin/sing-box" \
57 --replace-fail "/bin/kill" "${coreutils}/bin/kill"
58 install -Dm444 -t "$out/lib/systemd/system/" release/config/sing-box{,@}.service
62 updateScript = nix-update-script { };
63 tests = { inherit (nixosTests) sing-box; };
67 homepage = "https://sing-box.sagernet.org";
68 description = "The universal proxy platform";
69 license = licenses.gpl3Plus;
70 maintainers = with maintainers; [ nickcao ];
71 mainProgram = "sing-box";