summaryrefslogtreecommitdiff
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 @@
1version: 2
2updates:
3 - package-ecosystem: github-actions
4 directory: "/"
5 schedule:
6 interval: daily
7 commit-message:
8 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 @@
1name: CI
2
3on:
4 pull_request:
5 push:
6 branches:
7 - main
8 workflow_dispatch:
9
10jobs:
11 build:
12 name: Build
13 runs-on: ubuntu-latest
14 steps:
15 - uses: actions/checkout@v4
16
17 - uses: DeterminateSystems/nix-installer-action@v11
18
19 - run: nix -vL --show-trace flake check
20
21 - run: nix -vL --show-trace build
22
23 - uses: actions/upload-artifact@v4
24 with:
25 name: zmk_firmware
26 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 @@
1name: Dependencies
2
3on:
4 schedule:
5 - cron: '0 0 * * 0'
6 workflow_dispatch:
7
8permissions:
9 pull-requests: write
10 contents: write
11
12jobs:
13 update:
14 name: Update
15 runs-on: ubuntu-latest
16 permissions:
17 actions: write
18 contents: write
19 pull-requests: write
20 steps:
21 - uses: actions/checkout@v4
22
23 - uses: DeterminateSystems/nix-installer-action@v12
24
25 - run: nix -vL run --show-trace .#update
26
27 - id: create-pr
28 uses: peter-evans/create-pull-request@v6
29 with:
30 branch: update_zmk_config_deps
31 delete-branch: true
32 committer: 'github-actions[bot] <github-actions[bot]@users.noreply.github.com>'
33 author: 'github-actions[bot] <github-actions[bot]@users.noreply.github.com>'
34 commit-message: 'config,nix: update deps'
35 title: 'config,nix: update deps'
36 labels: 'dependencies'
37 body: |
38 Automated bump of ZMK dependencies
39
40 - uses: benc-uk/workflow-dispatch@v1
41 if: ${{ contains(fromJSON('["created", "updated"]'), steps.create-pr.outputs.pull-request-operation) }}
42 with:
43 workflow: ci.yml
44 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 @@
1name: Flake
2
3on:
4 schedule:
5 - cron: '0 0 * * 0'
6 workflow_dispatch:
7
8jobs:
9 update:
10 name: Update
11 runs-on: ubuntu-latest
12 permissions:
13 actions: write
14 contents: write
15 pull-requests: write
16 steps:
17 - uses: actions/checkout@v4
18
19 - uses: DeterminateSystems/nix-installer-action@v11
20
21 - id: update-flake-lock
22 uses: DeterminateSystems/update-flake-lock@v21
23 with:
24 commit-msg: 'flake: update inputs'
25 pr-title: 'flake: update inputs'
26 pr-labels: 'dependencies'
27
28 - uses: benc-uk/workflow-dispatch@v1
29 if: ${{ contains(fromJSON('["created", "updated"]'), steps.update-flake-lock.outputs.pull-request-operation) }}
30 with:
31 workflow: ci.yml
32 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 @@
1/.west
2/modules
3/zephyr
4/zmk
5/build
diff --git a/config/west.yml b/config/west.yml
new file mode 100644
index 0000000..61826bf
--- /dev/null
+++ b/config/west.yml
@@ -0,0 +1,34 @@
1manifest:
2 remotes:
3 - name: zmkfirmware
4 url-base: https://github.com/zmkfirmware
5 projects:
6 - name: zmk
7 remote: zmkfirmware
8 revision: 4da89bd99716bf6c1d7d788f3cdaec4cee7403e9 # main
9 import: app/west.yml
10 - name: zephyr
11 remote: zmkfirmware
12 revision: 0fa4cc26d8b1e5243570ccc0f7f66c4c428d2961 # v3.5.0+zmk-fixes
13 import:
14 name-blocklist:
15 - ci-tools
16 - hal_altera
17 - hal_cypress
18 - hal_infineon
19 - hal_microchip
20 - hal_nxp
21 - hal_openisa
22 - hal_silabs
23 - hal_xtensa
24 - hal_st
25 - hal_ti
26 - loramac-node
27 - mcuboot
28 - mcumgr
29 - net-tools
30 - openthread
31 - edtt
32 - trusted-firmware-m
33 self:
34 path: config
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..37081a7
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,48 @@
1{
2 "nodes": {
3 "nixpkgs": {
4 "locked": {
5 "lastModified": 1741865919,
6 "narHash": "sha256-4thdbnP6dlbdq+qZWTsm4ffAwoS8Tiq1YResB+RP6WE=",
7 "owner": "NixOS",
8 "repo": "nixpkgs",
9 "rev": "573c650e8a14b2faa0041645ab18aed7e60f0c9a",
10 "type": "github"
11 },
12 "original": {
13 "owner": "NixOS",
14 "ref": "nixpkgs-unstable",
15 "repo": "nixpkgs",
16 "type": "github"
17 }
18 },
19 "root": {
20 "inputs": {
21 "nixpkgs": "nixpkgs",
22 "zmk-nix": "zmk-nix"
23 }
24 },
25 "zmk-nix": {
26 "inputs": {
27 "nixpkgs": [
28 "nixpkgs"
29 ]
30 },
31 "locked": {
32 "lastModified": 1741480308,
33 "narHash": "sha256-dt1dNtAu0uL/Hm5SAjrUXxk9/J2n0qn87BYg0rCKC3E=",
34 "owner": "lilyinstarlight",
35 "repo": "zmk-nix",
36 "rev": "ea2d2b41854960a8f991302ea75c7b93596e6244",
37 "type": "github"
38 },
39 "original": {
40 "owner": "lilyinstarlight",
41 "repo": "zmk-nix",
42 "type": "github"
43 }
44 }
45 },
46 "root": "root",
47 "version": 7
48}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..2bbc123
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,42 @@
1{
2 inputs = {
3 nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
4
5 zmk-nix = {
6 url = "github:lilyinstarlight/zmk-nix";
7 inputs.nixpkgs.follows = "nixpkgs";
8 };
9 };
10
11 outputs = { self, nixpkgs, zmk-nix }: let
12 forAllSystems = nixpkgs.lib.genAttrs (nixpkgs.lib.attrNames zmk-nix.packages);
13 in {
14 packages = forAllSystems (system: rec {
15 default = firmware;
16
17 firmware = zmk-nix.legacyPackages.${system}.buildSplitKeyboard {
18 name = "firmware";
19
20 src = nixpkgs.lib.sourceFilesBySuffices self [ ".board" ".cmake" ".conf" ".defconfig" ".dts" ".dtsi" ".json" ".keymap" ".overlay" ".shield" ".yml" "_defconfig" ];
21
22 board = "nice_nano_v2";
23 shield = "cradio_%PART%";
24
25 zephyrDepsHash = "sha256-8h5lSnwxLTIqlvDNNl8fpv6hJFNF146Ck1qUWI/Cqqw=";
26
27 meta = {
28 description = "ZMK firmware";
29 license = nixpkgs.lib.licenses.mit;
30 platforms = nixpkgs.lib.platforms.all;
31 };
32 };
33
34 flash = zmk-nix.packages.${system}.flash.override { inherit firmware; };
35 update = zmk-nix.packages.${system}.update;
36 });
37
38 devShells = forAllSystems (system: {
39 default = zmk-nix.devShells.${system}.default;
40 });
41 };
42}