-
Notifications
You must be signed in to change notification settings - Fork 10
/
flake.nix
76 lines (62 loc) · 2.09 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
66
67
68
69
70
71
72
73
74
75
76
{
description = "BlueBuild's command line program that builds Containerfiles and custom images";
inputs = {
flake-schemas.url = "https://flakehub.com/f/DeterminateSystems/flake-schemas/*.tar.gz";
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.0.tar.gz";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, flake-schemas, nixpkgs, rust-overlay }:
let
overlays = [
rust-overlay.overlays.default
(final: prev: {
rustToolchain = (final.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml).override { extensions = [ "rust-src"]; };
})
];
supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f rec {
pkgs = import nixpkgs { inherit overlays system; };
lib = pkgs.lib;
});
in {
schemas = flake-schemas.schemas;
packages = forEachSupportedSystem ({ pkgs, lib }: rec {
default = bluebuild;
bluebuild = pkgs.rustPlatform.buildRustPackage {
pname = "bluebuild";
version = "v0.8.1";
src = pkgs.lib.cleanSource ./.;
cargoLock.lockFile = ./Cargo.lock;
meta = {
description = "BlueBuild's command line program that builds Containerfiles and custom images";
homepage = "https://github.com/blue-build/cli";
license = lib.licenses.apsl20;
};
};
});
devShells = forEachSupportedSystem ({ pkgs, ... }: {
default = pkgs.mkShell {
packages = with pkgs; [
rustToolchain
cargo-bloat
cargo-edit
cargo-outdated
cargo-watch
rust-analyzer
cargo
rustc
bacon
earthly
jq
nixpkgs-fmt
];
env = {
RUST_SRC_PATH = "${pkgs.rustToolchain}/lib/rustlib/src/rust/library";
};
};
});
};
}