Skip to content

Commit d753728

Browse files
authored
Merge pull request #21 from cmars/chore/nix-build
chore: nix flake build
2 parents 363f012 + 8d3effa commit d753728

File tree

3 files changed

+44
-1
lines changed

3 files changed

+44
-1
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,16 @@ Then `cargo install distrans` and other `cargo` commands should work.
2828

2929
The original author of this project develops on NixOS. If you Nix too,
3030

31+
### Developing
32+
3133
`nix develop` in here to get a devshell, then
3234

3335
`cargo build` and other `cargo` commands to do things.
3436

37+
### Running
38+
39+
`nix run github:cmars/distrans`
40+
3541
## CICD
3642

3743
Github is used for CICD and especially [release automation](https://blog.orhun.dev/automated-rust-releases/).

flake.lock

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+17-1
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@
1111
inputs.nixpkgs.follows = "nixpkgs";
1212
inputs.flake-utils.follows = "flake-utils";
1313
};
14+
15+
crane.url = "github:ipetkov/crane";
16+
crane.inputs.nixpkgs.follows = "nixpkgs";
1417
};
1518

16-
outputs = { self, nixpkgs, flake-utils, rust-overlay }:
19+
outputs = { self, nixpkgs, flake-utils, rust-overlay, crane }:
1720
(flake-utils.lib.eachDefaultSystem (system:
1821
let
1922
pkgs = import nixpkgs {
@@ -47,6 +50,19 @@
4750

4851
LIBCLANG_PATH="${pkgs.llvmPackages.libclang.lib}/lib";
4952
};
53+
54+
packages.default = crane.lib.${system}.buildPackage {
55+
src = ./.;
56+
57+
buildInputs = with pkgs; [
58+
cargo
59+
rust-bin.stable.latest.default
60+
capnproto
61+
protobuf
62+
pkg-config
63+
openssl
64+
];
65+
};
5066
}
5167
));
5268
}

0 commit comments

Comments
 (0)