-
Notifications
You must be signed in to change notification settings - Fork 265
/
Copy pathflake.nix
65 lines (56 loc) · 1.8 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.05";
utils.url = "github:gytis-ivaskevicius/flake-utils-plus";
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = inputs@{ self, utils, rust-overlay, ... }:
utils.lib.mkFlake rec {
inherit self inputs;
supportedSystems = [
"aarch64-linux"
"aarch64-darwin"
"i686-linux"
"x86_64-darwin"
"x86_64-linux"
];
sharedOverlays = [ (import rust-overlay) ];
outputsBuilder = channels: with channels; {
packages = with nixpkgs; {
inherit (nixpkgs) package-from-overlays;
nixpacks = rustPlatform.buildRustPackage {
pname = "nixpacks";
version = "v0.3.0";
doCheck = true;
src = ./.;
checkInputs = [ rustfmt clippy ];
# skip `cargo test` due tests FHS dependency
checkPhase = ''
runHook preCheck
cargo check
rustfmt --check src/**/*.rs
cargo clippy
runHook postCheck
'';
cargoLock = {
lockFile = ./Cargo.lock;
};
meta = with nixpkgs.lib; {
description = "App source + Nix packages + Docker = Image";
homepage = "https://github.com/railwayapp/nixpacks";
license = licenses.mit;
maintainers = [ maintainers.zoedsoupe ];
};
};
};
devShell = nixpkgs.mkShell {
name = "nixpacks";
buildInputs = with nixpkgs; [
# rust overlay already comes with complete toolchains
# see more at https://github.com/oxalica/rust-overlay
rust-bin.stable.latest.complete docker
];
};
};
};
}