forked from zmkfirmware/zmk
-
Notifications
You must be signed in to change notification settings - Fork 66
/
default.nix
51 lines (40 loc) · 1.37 KB
/
default.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
{ pkgs ? (import ./nix/pinned-nixpkgs.nix {}) }:
let
inherit (pkgs) newScope;
inherit (pkgs.lib) makeScope;
in
makeScope newScope (self: with self; {
west = pkgs.python3Packages.west.overrideAttrs(attrs: {
patches = (attrs.patches or []) ++ [./nix/west-manifest.patch];
});
# To update the pinned Zephyr dependecies using west and update-manifest:
# nix shell -f . west -c west init -l app
# nix shell -f . west -c west update
# nix shell -f . update-manifest -c update-manifest > nix/manifest.json
# Note that any `group-filter` groups in west.yml need to be temporarily
# removed, as `west update-manifest` requires all dependencies to be fetched.
update-manifest = callPackage ./nix/update-manifest { inherit west; };
combine_uf2 = a: b: pkgs.runCommandNoCC "combined_${a.name}_${b.name}" {}
''
mkdir -p $out
cat ${a}/zmk.uf2 ${b}/zmk.uf2 > $out/glove80.uf2
'';
zephyr = callPackage ./nix/zephyr.nix { };
zmk = callPackage ./nix/zmk.nix { };
zmk_settings_reset = zmk.override {
shield = "settings_reset";
};
glove80_left = zmk.override {
board = "glove80_lh";
};
glove80_right = zmk.override {
board = "glove80_rh";
};
glove80_combined = combine_uf2 glove80_left glove80_right;
glove80_v0_left = zmk.override {
board = "glove80_v0_lh";
};
glove80_v0_right = zmk.override {
board = "glove80_v0_rh";
};
})