-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
49 lines (45 loc) · 1.4 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
46
47
48
49
{
description =
"A unified CLI tool that brings Cargo's developer experience to Node.js";
inputs = {
nixpkgs.url =
"github:NixOS/nixpkgs?rev=de1864217bfa9b5845f465e771e0ecb48b30e02d";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
manifest = pkgs.lib.importTOML ./Cargo.toml;
package = manifest.package;
rustApp = pkgs.rustPlatform.buildRustPackage {
pname = package.name;
version = package.version;
src = pkgs.lib.cleanSource ./.;
cargoLock.lockFile = ./Cargo.lock;
meta = with pkgs.lib; {
inherit (package) description homepage repository;
license = licenses.mit;
maintainers = [ maintainers.xosnrdev ];
};
};
devShell = pkgs.mkShell {
buildInputs = [
pkgs.cargo-watch
pkgs.cargo-sort
pkgs.git-cliff
pkgs.cargo-release
pkgs.cargo-edit
pkgs.cargo-dist
pkgs.cargo-tarpaulin
];
shellHook = ''
export RUST_BACKTRACE=1
'';
};
in {
formatter = pkgs.nixfmt-classic;
packages = { default = rustApp; };
devShells.default = devShell;
});
}