forked from vedderb/vesc_tool
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
63 lines (59 loc) · 1.69 KB
/
flake.nix
File metadata and controls
63 lines (59 loc) · 1.69 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
{
description = "Packages VESC Tool into a flake.";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
# gcc-arm-embedded-7 has been removed from nixpkgs since 25.05 since it's
# old and unmaintained. However, this project still uses that version, so we
# include an older version of nixpkgs to access it.
nixpkgsOld.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,
nixpkgsOld,
flake-utils,
treefmt-nix,
bldcSrc,
}@inputs:
flake-utils.lib.eachSystem [ "x86_64-linux" ] (
system:
let
pkgs = import nixpkgs {
inherit system;
};
treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
selfPkgs = import ./pkgs {
inherit pkgs bldcSrc;
src = self;
gcc-arm-embedded-7 = nixpkgsOld.legacyPackages.${system}.gcc-arm-embedded-7;
};
in
{
packages = selfPkgs // {
default = selfPkgs.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 nixpkgsOld;
src = self;
};
# For development in the nix repl
inherit self;
};
}