-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
90 lines (76 loc) · 2.67 KB
/
Copy pathflake.nix
File metadata and controls
90 lines (76 loc) · 2.67 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Nix flake for bootintel-cli.
#
# Reproducible builds without pulling anything from crates.io during
# `nix build` (Cargo.lock is the lockfile; nix vendors from it).
#
# Usage:
# nix build .#bootintel # produces ./result/bin/bootintel
# nix run .# -- version # runs bootintel version
# nix develop # drops into a shell with rust + cargo
#
# In-repo only — not published to any Nix registry. Add
# `inputs.bootintel-cli.url = "github:bootintel/cli";`
# to consume from another flake.
{
description = "bootintel-cli — interactive UART capture + streaming boot-log analysis";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
# Feature set. `tui` is optional; toggle via `nix build .#bootintel-tui`
# once we want a separate derivation. Default is the full-featured
# binary that matches what install.sh delivers.
features = [ "tui" ];
bootintel = pkgs.rustPlatform.buildRustPackage {
pname = "bootintel-cli";
version = "0.3.1";
# Build from this directory (the repo root).
src = ./.;
cargoLock = {
lockFile = ./Cargo.lock;
};
buildFeatures = features;
# serialport needs libudev on Linux; arboard needs X/Wayland
# backends (only reached when the clipboard feature runs).
buildInputs = with pkgs; lib.optionals stdenv.isLinux [
udev
xorg.libxcb
];
nativeBuildInputs = with pkgs; [ pkg-config ];
# Skip `cargo test` inside nix — the integration tests spawn a
# TCP listener, which some Nix sandbox modes disallow. `cargo
# test` is run in CI + locally instead.
doCheck = false;
meta = with pkgs.lib; {
description = "Interactive UART capture + streaming boot-log analysis";
homepage = "https://bootintel.com";
license = licenses.asl20;
maintainers = [ ];
mainProgram = "bootintel";
};
};
in
{
packages = {
default = bootintel;
bootintel = bootintel;
};
apps.default = {
type = "app";
program = "${bootintel}/bin/bootintel";
};
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
rustc
cargo
rust-analyzer
pkg-config
udev
];
};
});
}