-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
45 lines (39 loc) · 1.2 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
description = "quickly create and manage temporary folders from the commandline";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "nixpkgs";
};
outputs = inputs: with inputs;
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
t-rs = pkgs.rustPlatform.buildRustPackage
rec {
pname = "t-rs";
version = "0.3.0";
src = ./.;
buildInputs = [ ];
nativeBuildInputs = with pkgs; [ pkg-config ];
cargoHash = "sha256-kZls/Bs/bygRT6u/6NmW6Zz+9B1RB2hEGSt7sLe9JK0=";
postInstall = ''
echo "function t {
pkg=$out" > $out/bin/t-rs.sh
echo ' cd $($pkg/bin/${pname} $@ | tail -n 1)
}' >> $out/bin/t-rs.sh
'';
meta = with pkgs.lib; {
description = "quickly create and manage temporary folders from the commandline";
homepage = "https://github.com/jdonszelmann/t-rs";
license = licenses.mit;
};
};
in
rec {
packages = {
inherit t-rs;
default = t-rs;
};
}
);
}