-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathflake.nix
81 lines (74 loc) · 2.1 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
nixpkgs-darwin.url = "github:NixOS/nixpkgs/nixpkgs-24.05-darwin";
# Version of requirements.txt installed in pythonEnv
zephyr = {
url = "github:zephyrproject-rtos/zephyr/v3.5.0";
flake = false;
};
# Zephyr sdk and toolchain
zephyr-nix = {
url = "github:urob/zephyr-nix";
inputs = {
zephyr.follows = "zephyr";
nixpkgs.follows = "nixpkgs";
};
};
zephyr-nix-darwin = {
url = "github:urob/zephyr-nix";
inputs = {
zephyr.follows = "zephyr";
nixpkgs.follows = "nixpkgs-darwin";
};
};
};
outputs = {
nixpkgs,
nixpkgs-darwin,
zephyr-nix,
zephyr-nix-darwin,
...
}: let
systems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
forAllSystems = nixpkgs.lib.genAttrs systems;
in {
devShells = forAllSystems (system: let
pkgs =
if (system == "x86_64-darwin" || system == "aarch64-darwin")
then nixpkgs-darwin.legacyPackages.${system}
else nixpkgs.legacyPackages.${system};
zephyr =
if (system == "x86_64-darwin" || system == "aarch64-darwin")
then zephyr-nix-darwin.packages.${system}
else zephyr-nix.packages.${system};
keymap_drawer = pkgs.python3Packages.callPackage ./draw {};
in {
default = pkgs.mkShell {
packages = [
# Editing tools.
pkgs.nixd
pkgs.alejandra
pkgs.prettierd
# ZMK.
keymap_drawer
zephyr.pythonEnv
(zephyr.sdk.override {targets = ["arm-zephyr-eabi"];})
pkgs.cmake
pkgs.dtc
pkgs.ninja
pkgs.qemu # needed for native_posix target
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.just # just
pkgs.gnused # sed
pkgs.yq # yq
];
};
});
};
}