-
Notifications
You must be signed in to change notification settings - Fork 404
/
Copy pathflake.nix
59 lines (52 loc) · 1.9 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
# This pins requirements.txt provided by zephyr-nix.pythonEnv.
zephyr.url = "github:zmkfirmware/zephyr/v3.5.0+zmk-fixes";
zephyr.flake = false;
# Zephyr sdk and toolchain.
zephyr-nix.url = "github:urob/zephyr-nix";
zephyr-nix.inputs.zephyr.follows = "zephyr";
zephyr-nix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { nixpkgs, zephyr-nix, ... }: let
systems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
forAllSystems = nixpkgs.lib.genAttrs systems;
in {
devShells = forAllSystems (
system: let
pkgs = nixpkgs.legacyPackages.${system};
zephyr = zephyr-nix.packages.${system};
keymap_drawer = pkgs.python3Packages.callPackage ./nix/keymap-drawer.nix {};
in {
default = pkgs.mkShellNoCC {
packages =
[
zephyr.pythonEnv
(zephyr.sdk-0_16.override {targets = ["arm-zephyr-eabi"];})
pkgs.cmake
pkgs.dtc
pkgs.ninja
pkgs.just
pkgs.yq # Make sure yq resolves to python-yq.
# -- Used by just_recipes and west_commands. Most systems already have them. --
# pkgs.gawk
# pkgs.unixtools.column
# pkgs.coreutils # cp, cut, echo, mkdir, sort, tail, tee, uniq, wc
# pkgs.diffutils
# pkgs.findutils # find, xargs
# pkgs.gnugrep
# pkgs.gnused
]
# Temporary disable keymap_drawer on aarch64-linux due to
# https://github.com/NixOS/nixpkgs/issues/372375.
++ nixpkgs.lib.optionals (system != "aarch64-linux") [keymap_drawer];
shellHook = ''
export ZMK_BUILD_DIR=$(pwd)/.build;
export ZMK_SRC_DIR=$(pwd)/zmk/app;
'';
};
}
);
};
}