-
Notifications
You must be signed in to change notification settings - Fork 2
/
flake.nix
89 lines (75 loc) · 2.02 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
77
78
79
80
81
82
83
84
85
86
87
88
89
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-github-actions = {
url = "github:nix-community/nix-github-actions";
inputs.nixpkgs.follows = "nixpkgs";
};
zephyr-nix = {
url = "github:adisbladis/zephyr-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs@{ flake-parts, ... }:
let
inherit (inputs.nixpkgs) lib;
inherit (inputs) self;
in
flake-parts.lib.mkFlake { inherit inputs; } {
systems = lib.systems.flakeExposed;
imports = [
inputs.treefmt-nix.flakeModule
];
flake.githubActions = inputs.nix-github-actions.lib.mkGithubMatrix {
checks = {
inherit (self.checks) x86_64-linux;
};
};
perSystem = { config, inputs', pkgs, ... }:
let
zephyr = inputs'.zephyr-nix.packages;
in
{
treefmt.config = {
projectRootFile = "flake.nix";
programs = {
black.enable = true;
clang-format = {
enable = true;
package = pkgs.clang-tools_17;
};
nixpkgs-fmt.enable = true;
shfmt.enable = true;
};
};
devShells.default = pkgs.mkShell {
inputsFrom = [
config.treefmt.build.devShell
];
packages = [
(zephyr.sdk.override {
targets = [
"arm-zephyr-eabi"
];
})
(zephyr.pythonEnv.override {
extraPackages = pkgs: [
pkgs.stringcase
];
})
zephyr.hosttools
pkgs.cmake
pkgs.ninja
];
};
};
};
}