aboutsummaryrefslogtreecommitdiffstats
path: root/flake.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2024-11-06 19:16:23 +0100
committertv <tv@krebsco.de>2024-11-06 19:16:23 +0100
commit77ec527f311091847b800fee01fd050953a65185 (patch)
treea4633c97ffd55d8b3db7dadfdba2ecb707f65d6c /flake.nix
initial commit
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix42
1 files changed, 42 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..7e5dd7c
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,42 @@
+{
+ inputs = {
+ nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
+
+ zmk-nix = {
+ url = "github:lilyinstarlight/zmk-nix";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
+ };
+
+ outputs = { self, nixpkgs, zmk-nix }: let
+ forAllSystems = nixpkgs.lib.genAttrs (nixpkgs.lib.attrNames zmk-nix.packages);
+ in {
+ packages = forAllSystems (system: rec {
+ default = firmware;
+
+ firmware = zmk-nix.legacyPackages.${system}.buildSplitKeyboard {
+ name = "firmware";
+
+ src = nixpkgs.lib.sourceFilesBySuffices self [ ".board" ".cmake" ".conf" ".defconfig" ".dts" ".dtsi" ".json" ".keymap" ".overlay" ".shield" ".yml" "_defconfig" ];
+
+ board = "nice_nano_v2";
+ shield = "lily58_%PART%";
+
+ zephyrDepsHash = "sha256-9xdpgu0/A2ZWmJNSlyQ172MGCnkOf/A8WLYp7dvjJ5A=";
+
+ meta = {
+ description = "ZMK firmware";
+ license = nixpkgs.lib.licenses.mit;
+ platforms = nixpkgs.lib.platforms.all;
+ };
+ };
+
+ flash = zmk-nix.packages.${system}.flash.override { inherit firmware; };
+ update = zmk-nix.packages.${system}.update;
+ });
+
+ devShells = forAllSystems (system: {
+ default = zmk-nix.devShells.${system}.default;
+ });
+ };
+}