-
Notifications
You must be signed in to change notification settings - Fork 548
/
Copy pathflake.nix
64 lines (60 loc) · 1.55 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
{
description = "Packages VESC Tool into a flake.";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
flake-utils.url = "github:numtide/flake-utils";
treefmt-nix.url = "github:numtide/treefmt-nix";
bldcSrc = {
url = "github:vedderb/bldc/release_6_05";
flake = false;
};
};
# TODO: Add support for building on/for other systems.
outputs =
{
self,
nixpkgs,
flake-utils,
treefmt-nix,
bldcSrc,
}@inputs:
flake-utils.lib.eachSystem [ "x86_64-linux" ] (
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
};
treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
in
{
packages = {
inherit (pkgs)
vesc-tool
vesc-tool-free
vesc-tool-copper
vesc-tool-bronze
vesc-tool-silver
vesc-tool-gold
vesc-tool-platinum
;
bldc-fw = pkgs.callPackage ./pkgs/vesc-tool/bldc-fw.nix { src = bldcSrc; };
default = pkgs.vesc-tool;
};
# For `nix fmt`
formatter = treefmtEval.config.build.wrapper;
checks = {
# For `nix flake check`
formatting = treefmtEval.config.build.check self;
};
}
)
// {
overlays.default = (nixpkgs.lib.makeOverridable (import ./overlay.nix)) {
inherit bldcSrc;
src = self;
};
# For development in the nix repl
inherit self;
};
}