-
Notifications
You must be signed in to change notification settings - Fork 383
/
Copy pathflake.nix
56 lines (47 loc) · 1.67 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
# Version of requirements.txt installed in 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 = [
keymap_drawer
zephyr.pythonEnv
(zephyr.sdk-0_16.override { targets = [ "arm-zephyr-eabi" ]; })
pkgs.cmake
pkgs.dtc
pkgs.ninja
pkgs.just
pkgs.yq # make sure we use the python version
# -- Uncomment these if you don't have system-wide versions --
# pkgs.gawk # awk
# pkgs.unixtools.column # column
# pkgs.coreutils # cp, cut, echo, mkdir, sort, tail, tee, uniq, wc
# pkgs.diffutils # diff
# pkgs.findutils # find, xargs
# pkgs.gnugrep # grep
# pkgs.gnused # sed
];
shellHook = ''
export ZMK_BUILD_DIR=$(pwd)/.build;
export ZMK_SRC_DIR=$(pwd)/zmk/app;
'';
};
});
};
}