Skip to content

Commit

Permalink
Format flake
Browse files Browse the repository at this point in the history
  • Loading branch information
urob committed Jan 22, 2025
1 parent b460b8f commit 9dad5f5
Showing 1 changed file with 42 additions and 40 deletions.
82 changes: 42 additions & 40 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,56 +2,58 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";

# Version of requirements.txt installed in pythonEnv
# 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 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" ];
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 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
]
# 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;
'';
};
});
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;
'';
};
}
);
};
}

0 comments on commit 9dad5f5

Please sign in to comment.