aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/dependabot.yml8
-rw-r--r--.github/workflows/ci.yml26
-rw-r--r--.github/workflows/deps.yml44
-rw-r--r--.github/workflows/flake.yml32
-rw-r--r--.gitignore5
-rw-r--r--config/west.yml34
-rw-r--r--flake.lock48
-rw-r--r--flake.nix42
8 files changed, 239 insertions, 0 deletions
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000..9922df0
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,8 @@
+version: 2
+updates:
+ - package-ecosystem: github-actions
+ directory: "/"
+ schedule:
+ interval: daily
+ commit-message:
+ prefix: "ci"
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..e0e90f4
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,26 @@
+name: CI
+
+on:
+ pull_request:
+ push:
+ branches:
+ - main
+ workflow_dispatch:
+
+jobs:
+ build:
+ name: Build
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - uses: DeterminateSystems/nix-installer-action@v11
+
+ - run: nix -vL --show-trace flake check
+
+ - run: nix -vL --show-trace build
+
+ - uses: actions/upload-artifact@v4
+ with:
+ name: zmk_firmware
+ path: result
diff --git a/.github/workflows/deps.yml b/.github/workflows/deps.yml
new file mode 100644
index 0000000..b1ba83b
--- /dev/null
+++ b/.github/workflows/deps.yml
@@ -0,0 +1,44 @@
+name: Dependencies
+
+on:
+ schedule:
+ - cron: '0 0 * * 0'
+ workflow_dispatch:
+
+permissions:
+ pull-requests: write
+ contents: write
+
+jobs:
+ update:
+ name: Update
+ runs-on: ubuntu-latest
+ permissions:
+ actions: write
+ contents: write
+ pull-requests: write
+ steps:
+ - uses: actions/checkout@v4
+
+ - uses: DeterminateSystems/nix-installer-action@v12
+
+ - run: nix -vL run --show-trace .#update
+
+ - id: create-pr
+ uses: peter-evans/create-pull-request@v6
+ with:
+ branch: update_zmk_config_deps
+ delete-branch: true
+ committer: 'github-actions[bot] <github-actions[bot]@users.noreply.github.com>'
+ author: 'github-actions[bot] <github-actions[bot]@users.noreply.github.com>'
+ commit-message: 'config,nix: update deps'
+ title: 'config,nix: update deps'
+ labels: 'dependencies'
+ body: |
+ Automated bump of ZMK dependencies
+
+ - uses: benc-uk/workflow-dispatch@v1
+ if: ${{ contains(fromJSON('["created", "updated"]'), steps.create-pr.outputs.pull-request-operation) }}
+ with:
+ workflow: ci.yml
+ ref: refs/heads/update_zmk_config_deps
diff --git a/.github/workflows/flake.yml b/.github/workflows/flake.yml
new file mode 100644
index 0000000..5aef002
--- /dev/null
+++ b/.github/workflows/flake.yml
@@ -0,0 +1,32 @@
+name: Flake
+
+on:
+ schedule:
+ - cron: '0 0 * * 0'
+ workflow_dispatch:
+
+jobs:
+ update:
+ name: Update
+ runs-on: ubuntu-latest
+ permissions:
+ actions: write
+ contents: write
+ pull-requests: write
+ steps:
+ - uses: actions/checkout@v4
+
+ - uses: DeterminateSystems/nix-installer-action@v11
+
+ - id: update-flake-lock
+ uses: DeterminateSystems/update-flake-lock@v21
+ with:
+ commit-msg: 'flake: update inputs'
+ pr-title: 'flake: update inputs'
+ pr-labels: 'dependencies'
+
+ - uses: benc-uk/workflow-dispatch@v1
+ if: ${{ contains(fromJSON('["created", "updated"]'), steps.update-flake-lock.outputs.pull-request-operation) }}
+ with:
+ workflow: ci.yml
+ ref: refs/heads/update_flake_lock_action
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..f083fd4
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+/.west
+/modules
+/zephyr
+/zmk
+/build
diff --git a/config/west.yml b/config/west.yml
new file mode 100644
index 0000000..0103a1f
--- /dev/null
+++ b/config/west.yml
@@ -0,0 +1,34 @@
+manifest:
+ remotes:
+ - name: zmkfirmware
+ url-base: https://github.com/zmkfirmware
+ projects:
+ - name: zmk
+ remote: zmkfirmware
+ revision: 9935e8df471379538e5e4e046c716a0f1740eaf2 # main
+ import: app/west.yml
+ - name: zephyr
+ remote: zmkfirmware
+ revision: f8e4d15791602c67405c0fd2651167a895939565 # v3.5.0+zmk-fixes
+ import:
+ name-blocklist:
+ - ci-tools
+ - hal_altera
+ - hal_cypress
+ - hal_infineon
+ - hal_microchip
+ - hal_nxp
+ - hal_openisa
+ - hal_silabs
+ - hal_xtensa
+ - hal_st
+ - hal_ti
+ - loramac-node
+ - mcuboot
+ - mcumgr
+ - net-tools
+ - openthread
+ - edtt
+ - trusted-firmware-m
+ self:
+ path: config
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..5d1e8d2
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,48 @@
+{
+ "nodes": {
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1730831018,
+ "narHash": "sha256-2S0HwIFRxYp+afuoFORcZA9TjryAf512GmE0MTfEOPU=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "8c4dc69b9732f6bbe826b5fbb32184987520ff26",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "nixpkgs-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "nixpkgs": "nixpkgs",
+ "zmk-nix": "zmk-nix"
+ }
+ },
+ "zmk-nix": {
+ "inputs": {
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1730663558,
+ "narHash": "sha256-qJG7KoBmO326k4c3JnUI8cQ0aEi5tx/bnQl2nIw1hnI=",
+ "owner": "lilyinstarlight",
+ "repo": "zmk-nix",
+ "rev": "f9fceeff2451a0db6fb72909e7f30868151ea175",
+ "type": "github"
+ },
+ "original": {
+ "owner": "lilyinstarlight",
+ "repo": "zmk-nix",
+ "type": "github"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
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;
+ });
+ };
+}