@@ -0,0 +1,44 @@
1+{ lib
2+, rustPlatform
3+, steamcmd
4+, fetchFromGitHub
5+, steam-run-native
6+, runtimeShell
7+, withWine ? false
8+, wine
9+}:
10+
11+rustPlatform.buildRustPackage rec {
12+ pname = "steam-tui";
13+ version = "0.1.0";
14+
15+ src = fetchFromGitHub {
16+ owner = "dmadisetti";
17+ repo = pname;
18+ rev = version;
19+ sha256 = "sha256-UTXYlPecv0MVonr9zZwfwopfC/Fdch/ZSCxqgUsem40=";
20+ };
21+
22+ cargoSha256 = "sha256-VYBzwDLSV4N4qt2dNgIS399T2HIbPTdQ2rDIeheLlfo=";
23+
24+ buildInputs = [ steamcmd steam-run-native ]
25+ ++ lib.optional withWine wine;
26+
27+ preFixup = ''
28+ mv $out/bin/steam-tui $out/bin/.steam-tui-unwrapped
29+ cat > $out/bin/steam-tui <<EOF
30+ #!${runtimeShell}
31+ exec steam-run $out/bin/.steam-tui-unwrapped '$@'
32+ EOF
33+ chmod +x $out/bin/steam-tui
34+ '';
35+
36+ meta = with lib; {
37+ description = "Rust TUI client for steamcmd";
38+ homepage = "https://github.com/dmadisetti/steam-tui";
39+ license = licenses.mit;
40+ maintainers = with maintainers; [ legendofmiracles ];
41+ # steam only supports that platform
42+ platforms = [ "x86_64-linux" ];
43+ };
44+}