-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathflake.nix
More file actions
111 lines (94 loc) · 2.72 KB
/
Copy pathflake.nix
File metadata and controls
111 lines (94 loc) · 2.72 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
treefmt-nix = {
url = "github:numtide/treefmt-nix/246639a1ec081bb40941a25e9eb8481a66d71b49";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-github-actions = {
url = "github:nix-community/nix-github-actions";
inputs.nixpkgs.follows = "nixpkgs";
};
zephyr-nix = {
url = "github:nix-community/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_19;
};
nixpkgs-fmt.enable = true;
shfmt.enable = true;
};
settings.formatter = {
clang-format = {
options = [ "-i" "-style=file:${inputs.zephyr-nix.inputs.zephyr}/.clang-format" ];
excludes = [ "build/*" "twister-out*/*" ];
};
};
};
devShells.default = pkgs.mkShell {
inputsFrom = [
config.treefmt.build.devShell
];
packages = [
(zephyr.sdk-1_0_0.override {
targets = [
"arm-zephyr-eabi"
];
})
(zephyr.pythonEnv.override {
extraPackages = pkgs: [
pkgs.stringcase
];
})
zephyr.hosttools
pkgs.cmake
pkgs.ninja
];
shellHook = ''
export LOCALE_ARCHIVE="${pkgs.glibcLocales}/lib/locale/locale-archive";
export LC_ALL="C.UTF-8";
export LANG="C.UTF-8";
'';
};
};
};
nixConfig = {
extra-substituters = [
"https://cache.freedom.ind.br"
];
extra-trusted-public-keys = [
"cache.freedom.ind.br:4+Tt+AZreSw+P7xP0d6eHtIHhSAlkFbSa/9ugOkiMSM="
];
};
}