Skip to content

Commit 4ecc06c

Browse files
committed
Add flake support
1 parent 573b4db commit 4ecc06c

File tree

2 files changed

+166
-0
lines changed

2 files changed

+166
-0
lines changed

flake.lock

Lines changed: 129 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
inputs = {
3+
fenix.url = "github:nix-community/fenix";
4+
flake-utils.url = "github:numtide/flake-utils";
5+
naersk.url = "github:nix-community/naersk";
6+
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
7+
};
8+
9+
outputs = { self, fenix, flake-utils, naersk, nixpkgs }:
10+
flake-utils.lib.eachDefaultSystem (
11+
system: let
12+
pkgs = (import nixpkgs) {
13+
inherit system;
14+
};
15+
16+
toolchain = with fenix.packages.${system};
17+
combine [
18+
minimal.cargo
19+
minimal.rustc
20+
targets.x86_64-unknown-linux-musl.latest.rust-std
21+
];
22+
23+
naersk' = naersk.lib.${system}.override {
24+
cargo = toolchain;
25+
rustc = toolchain;
26+
};
27+
28+
in rec {
29+
defaultPackage = naersk'.buildPackage {
30+
CARGO_BUILD_TARGET = "x86_64-unknown-linux-musl";
31+
doCheck = true;
32+
nativeBuildInputs = with pkgs; [ pkgsStatic.stdenv.cc ];
33+
src = ./.;
34+
};
35+
}
36+
);
37+
}

0 commit comments

Comments
 (0)