From f8d3cc70544d5b18f27f15e2ed59562683c7898a Mon Sep 17 00:00:00 2001 From: issy Date: Sat, 21 Mar 2026 12:18:32 +0000 Subject: [PATCH 01/11] Add flake for web project Add node 24 to flake Reorder --- web/flake.lock | 61 ++++++++++++++++++++++++++++++++++++++++++++++++ web/flake.nix | 44 ++++++++++++++++++++++++++++++++++ web/package.json | 2 +- 3 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 web/flake.lock create mode 100644 web/flake.nix diff --git a/web/flake.lock b/web/flake.lock new file mode 100644 index 0000000..64ec4c4 --- /dev/null +++ b/web/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1773814637, + "narHash": "sha256-GNU+ooRmrHLfjlMsKdn0prEKVa0faVanm0jrgu1J/gY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "fea3b367d61c1a6592bc47c72f40a9f3e6a53e96", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/web/flake.nix b/web/flake.nix new file mode 100644 index 0000000..dcec0c9 --- /dev/null +++ b/web/flake.nix @@ -0,0 +1,44 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = + { + self, + nixpkgs, + flake-utils, + }: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = import nixpkgs { inherit system; }; + + commonArgs = { + src = pkgs.lib.cleanSourceWith { + src = ./.; + name = "source"; + }; + strictDeps = true; + buildInputs = [ ]; + version = "0.1.0"; + pname = "app"; + }; + in + rec { + defaultPackage = commonArgs; + + devShell = pkgs.mkShell { + packages = with pkgs; [ + nodejs_24 + pnpm + ]; + shellHook = '' + echo "📦 Installing dependencies..." + pnpm install --frozen-lockfile --quiet + ''; + }; + } + ); +} diff --git a/web/package.json b/web/package.json index ac32d84..ca089d7 100644 --- a/web/package.json +++ b/web/package.json @@ -3,7 +3,7 @@ "private": true, "version": "0.0.0", "type": "module", - "packageManager": "pnpm@10.29.3", + "packageManager": "pnpm@10.32.1", "scripts": { "dev": "vite", "build": "tsc -b && vite build", From 58a23de31ea45f2ea78781f061c344c2548fe6d0 Mon Sep 17 00:00:00 2001 From: issy Date: Sat, 21 Mar 2026 12:27:37 +0000 Subject: [PATCH 02/11] Web README --- web/README.md | 76 ++------------------------------------------------- 1 file changed, 3 insertions(+), 73 deletions(-) diff --git a/web/README.md b/web/README.md index 8d2feca..f523537 100644 --- a/web/README.md +++ b/web/README.md @@ -1,75 +1,5 @@ -# React + TypeScript + Vite +# Web -This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. +This is the web app for the MIDI controller. From here you can edit the configuration, test local development of the firmware, and even do firmware updates. -Currently, two official plugins are available: - -- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh -- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh - -## React Compiler - -The React Compiler is enabled on this template. See [this documentation](https://react.dev/learn/react-compiler) for more information. - -Note: This will impact Vite dev & build performances. - -## Expanding the ESLint configuration - -If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules: - -```js -export default defineConfig([ - globalIgnores(['dist']), - { - files: ['**/*.{ts,tsx}'], - extends: [ - // Other configs... - - // Remove tseslint.configs.recommended and replace with this - tseslint.configs.recommendedTypeChecked, - // Alternatively, use this for stricter rules - tseslint.configs.strictTypeChecked, - // Optionally, add this for stylistic rules - tseslint.configs.stylisticTypeChecked, - - // Other configs... - ], - languageOptions: { - parserOptions: { - project: ['./tsconfig.node.json', './tsconfig.app.json'], - tsconfigRootDir: import.meta.dirname, - }, - // other options... - }, - }, -]); -``` - -You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules: - -```js -// eslint.config.js -import reactX from 'eslint-plugin-react-x'; -import reactDom from 'eslint-plugin-react-dom'; - -export default defineConfig([ - globalIgnores(['dist']), - { - files: ['**/*.{ts,tsx}'], - extends: [ - // Other configs... - // Enable lint rules for React - reactX.configs['recommended-typescript'], - // Enable lint rules for React DOM - reactDom.configs.recommended, - ], - languageOptions: { - parserOptions: { - project: ['./tsconfig.node.json', './tsconfig.app.json'], - tsconfigRootDir: import.meta.dirname, - }, - // other options... - }, - }, -]); -``` +To get started, run `nix develop .` From 23211c2c76a8926fe324f57960ce0d56b9968f35 Mon Sep 17 00:00:00 2001 From: issy Date: Sat, 21 Mar 2026 16:25:56 +0000 Subject: [PATCH 03/11] Update lock --- web/flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/flake.lock b/web/flake.lock index 64ec4c4..5e37bc4 100644 --- a/web/flake.lock +++ b/web/flake.lock @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1773814637, - "narHash": "sha256-GNU+ooRmrHLfjlMsKdn0prEKVa0faVanm0jrgu1J/gY=", + "lastModified": 1773964973, + "narHash": "sha256-NV/J+tTER0P5iJhUDL/8HO5MDjDceLQPRUYgdmy5wXw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "fea3b367d61c1a6592bc47c72f40a9f3e6a53e96", + "rev": "812b3986fd1568f7a858f97fcf425ad996ba7d25", "type": "github" }, "original": { From 747c5649c2f59f4bcc2dbf86bef8f07e8d57c9a0 Mon Sep 17 00:00:00 2001 From: issy Date: Sat, 21 Mar 2026 16:52:56 +0000 Subject: [PATCH 04/11] Add root flake --- flake.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 flake.nix diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..3147865 --- /dev/null +++ b/flake.nix @@ -0,0 +1,17 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; + utils.url = "github:numtide/flake-utils"; + }; + outputs = { self, nixpkgs, utils }: utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + { + devShell = pkgs.mkShell { + buildInputs = with pkgs; [ + ]; + }; + } + ); +} From 3d670aaee40c905f8a4ed37e5025edf1f1e4a65c Mon Sep 17 00:00:00 2001 From: issy Date: Sat, 21 Mar 2026 16:53:10 +0000 Subject: [PATCH 05/11] Lock root flake --- flake.lock | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 flake.lock diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..3fd3622 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1773964973, + "narHash": "sha256-NV/J+tTER0P5iJhUDL/8HO5MDjDceLQPRUYgdmy5wXw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "812b3986fd1568f7a858f97fcf425ad996ba7d25", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "utils": "utils" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} From 4c4dca441f15de76628351d0da1e5f90a18a1241 Mon Sep 17 00:00:00 2001 From: issy Date: Sat, 21 Mar 2026 17:06:30 +0000 Subject: [PATCH 06/11] Add build/install phases --- web/flake.nix | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/web/flake.nix b/web/flake.nix index dcec0c9..3005771 100644 --- a/web/flake.nix +++ b/web/flake.nix @@ -22,14 +22,26 @@ }; strictDeps = true; buildInputs = [ ]; + nativeBuildInputs = with pkgs; [ + nodejs_24 + pnpm + ]; + buildPhase = '' + pnpm install --frozen-lockfile + pnpm build + ''; + installPhase = '' + mkdir -p $out + cp -r dist/* $out/ + ''; version = "0.1.0"; - pname = "app"; + pname = "app-web"; }; in rec { - defaultPackage = commonArgs; + packages.default = pkgs.stdenv.mkDerivation commonArgs; - devShell = pkgs.mkShell { + devShells.default = pkgs.mkShell { packages = with pkgs; [ nodejs_24 pnpm From 188a625fb577b5a7149c0238bb92e2d48a565c91 Mon Sep 17 00:00:00 2001 From: issy Date: Sat, 21 Mar 2026 17:06:39 +0000 Subject: [PATCH 07/11] Add sub packages --- flake.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 3147865..2261a94 100644 --- a/flake.nix +++ b/flake.nix @@ -2,8 +2,19 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; utils.url = "github:numtide/flake-utils"; + + app-firmware = { + url = "./firmware"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.utils.follows = "utils"; + }; + app-web = { + url = "./web"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.utils.follows = "utils"; + }; }; - outputs = { self, nixpkgs, utils }: utils.lib.eachDefaultSystem (system: + outputs = { self, nixpkgs, utils, app-firmware, app-web }: utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages.${system}; in From c3c6d31d07f738ae200d1bb76c0f3c15c58f0939 Mon Sep 17 00:00:00 2001 From: issy Date: Sat, 21 Mar 2026 17:08:41 +0000 Subject: [PATCH 08/11] Fix utils reference --- flake.lock | 118 ++++++++++++++++++++++++++++++++++++++++++++--------- flake.nix | 8 ++-- 2 files changed, 102 insertions(+), 24 deletions(-) diff --git a/flake.lock b/flake.lock index 3fd3622..a9fab9f 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,78 @@ { "nodes": { + "app-firmware": { + "inputs": { + "crane": "crane", + "flake-utils": [ + "flake-utils" + ], + "nixpkgs": [ + "nixpkgs" + ], + "rust-overlay": "rust-overlay" + }, + "locked": { + "path": "./firmware", + "type": "path" + }, + "original": { + "path": "./firmware", + "type": "path" + }, + "parent": [] + }, + "app-web": { + "inputs": { + "flake-utils": [ + "flake-utils" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "path": "./web", + "type": "path" + }, + "original": { + "path": "./web", + "type": "path" + }, + "parent": [] + }, + "crane": { + "locked": { + "lastModified": 1773189535, + "narHash": "sha256-E1G/Or6MWeP+L6mpQ0iTFLpzSzlpGrITfU2220Gq47g=", + "owner": "ipetkov", + "repo": "crane", + "rev": "6fa2fb4cf4a89ba49fc9dd5a3eb6cde99d388269", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1773964973, @@ -18,8 +91,31 @@ }, "root": { "inputs": { - "nixpkgs": "nixpkgs", - "utils": "utils" + "app-firmware": "app-firmware", + "app-web": "app-web", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "app-firmware", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1773544328, + "narHash": "sha256-Iv+qez54LAz+isij4APBk31VWA//Go81hwFOXr5iWTw=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "4f977d776793c8bfbfdd7eca7835847ccc48874e", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" } }, "systems": { @@ -36,24 +132,6 @@ "repo": "default", "type": "github" } - }, - "utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 2261a94..88b95c3 100644 --- a/flake.nix +++ b/flake.nix @@ -1,20 +1,20 @@ { inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; - utils.url = "github:numtide/flake-utils"; + flake-utils.url = "github:numtide/flake-utils"; app-firmware = { url = "./firmware"; inputs.nixpkgs.follows = "nixpkgs"; - inputs.utils.follows = "utils"; + inputs.flake-utils.follows = "flake-utils"; }; app-web = { url = "./web"; inputs.nixpkgs.follows = "nixpkgs"; - inputs.utils.follows = "utils"; + inputs.flake-utils.follows = "flake-utils"; }; }; - outputs = { self, nixpkgs, utils, app-firmware, app-web }: utils.lib.eachDefaultSystem (system: + outputs = { self, nixpkgs, flake-utils, app-firmware, app-web }: flake-utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages.${system}; in From 4ddc94a3911fca97dc7cc0702d582fa14464655f Mon Sep 17 00:00:00 2001 From: issy Date: Sat, 21 Mar 2026 17:15:26 +0000 Subject: [PATCH 09/11] Trying to build all packages from the root flake --- firmware/flake.nix | 2 +- flake.nix | 6 ++++++ web/flake.nix | 5 ++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/firmware/flake.nix b/firmware/flake.nix index 469f8b3..5c6d307 100644 --- a/firmware/flake.nix +++ b/firmware/flake.nix @@ -52,7 +52,7 @@ }; in rec { - defaultPackage = craneLib.buildPackage commonArgs; + packages.default = craneLib.buildPackage commonArgs; devShell = craneLib.devShell { packages = with pkgs; [ diff --git a/flake.nix b/flake.nix index 88b95c3..3a48bdd 100644 --- a/flake.nix +++ b/flake.nix @@ -19,8 +19,14 @@ pkgs = nixpkgs.legacyPackages.${system}; in { + packages = { + app-firmware = app-firmware.packages.${system}.default; + app-web = app-web.packages.${system}.default; + }; + devShell = pkgs.mkShell { buildInputs = with pkgs; [ + ]; }; } diff --git a/web/flake.nix b/web/flake.nix index 3005771..4e845fb 100644 --- a/web/flake.nix +++ b/web/flake.nix @@ -21,7 +21,10 @@ name = "source"; }; strictDeps = true; - buildInputs = [ ]; + buildInputs = with pkgs; [ + nodejs_24 + pnpm + ]; nativeBuildInputs = with pkgs; [ nodejs_24 pnpm From e2320afc833e40613e925ed087813a878cabd383 Mon Sep 17 00:00:00 2001 From: issy Date: Sat, 21 Mar 2026 17:25:37 +0000 Subject: [PATCH 10/11] Formatting for consistency --- flake.nix | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/flake.nix b/flake.nix index 3a48bdd..c8444ab 100644 --- a/flake.nix +++ b/flake.nix @@ -14,21 +14,30 @@ inputs.flake-utils.follows = "flake-utils"; }; }; - outputs = { self, nixpkgs, flake-utils, app-firmware, app-web }: flake-utils.lib.eachDefaultSystem (system: - let - pkgs = nixpkgs.legacyPackages.${system}; - in + outputs = { - packages = { - app-firmware = app-firmware.packages.${system}.default; - app-web = app-web.packages.${system}.default; - }; + self, + nixpkgs, + flake-utils, + app-firmware, + app-web + }: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + { + packages = { + app-firmware = app-firmware.packages.${system}.default; + app-web = app-web.packages.${system}.default; + }; - devShell = pkgs.mkShell { - buildInputs = with pkgs; [ + devShell = pkgs.mkShell { + buildInputs = with pkgs; [ - ]; - }; - } - ); + ]; + }; + } + ); } From 3c0fe5929b269da95101ffa0d59f21368d3d4af5 Mon Sep 17 00:00:00 2001 From: issy Date: Sat, 21 Mar 2026 17:42:42 +0000 Subject: [PATCH 11/11] Blah --- web/flake.nix | 8 -------- 1 file changed, 8 deletions(-) diff --git a/web/flake.nix b/web/flake.nix index 4e845fb..2a08577 100644 --- a/web/flake.nix +++ b/web/flake.nix @@ -21,10 +21,6 @@ name = "source"; }; strictDeps = true; - buildInputs = with pkgs; [ - nodejs_24 - pnpm - ]; nativeBuildInputs = with pkgs; [ nodejs_24 pnpm @@ -33,10 +29,6 @@ pnpm install --frozen-lockfile pnpm build ''; - installPhase = '' - mkdir -p $out - cp -r dist/* $out/ - ''; version = "0.1.0"; pname = "app-web"; };