From 8362df9fd17315775ed7e6169df89b486825f128 Mon Sep 17 00:00:00 2001 From: Divit Mittal <64.69.76.69.74.m@gmail.com> Date: Thu, 22 Oct 2026 05:44:06 +0530 Subject: [PATCH 1/3] feat(nix): support x86_64-darwin via nixpkgs-26.05-darwin Nixpkgs 26.11 dropped x86_64-darwin, so every output on that system threw at evaluation. Use nixpkgs-26.05-darwin for perSystem pkgs there (nixpkgs-unstable everywhere else), matching term-nixCfg/ai-nixCfg. apm-cli isn't packaged in 26.05, so the devshell runs the same PyPI release (microsoft/apm) ephemerally via uv when pkgs lacks it. --- flake.lock | 17 +++++++++++++++++ flake.nix | 13 ++++++++++++- flake/devshells.nix | 7 ++++++- 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/flake.lock b/flake.lock index fe944b7..c9e9e20 100644 --- a/flake.lock +++ b/flake.lock @@ -154,6 +154,22 @@ "type": "github" } }, + "nixpkgs-2605": { + "locked": { + "lastModified": 1792526774, + "narHash": "sha256-+qjpjRPb6ak1rkodfh7wEtgQB3DaAI5tg0kSklSUmio=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "36fd15bbb657815e2028e31d715c2e43a1230c91", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-26.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs-lib": { "locked": { "lastModified": 1777168982, @@ -177,6 +193,7 @@ "git-hooks": "git-hooks", "import-tree": "import-tree", "nixpkgs": "nixpkgs", + "nixpkgs-2605": "nixpkgs-2605", "systems": "systems", "treefmt-nix": "treefmt-nix" } diff --git a/flake.nix b/flake.nix index 20e2fc9..ce1cfa0 100644 --- a/flake.nix +++ b/flake.nix @@ -1,17 +1,28 @@ { description = "Rust-first USB Android software KVM backed by scrcpy"; - outputs = inputs: + outputs = inputs: let + # Nixpkgs 26.11 dropped x86_64-darwin; 26.05-darwin is the last branch + # that still supports (and caches) it, so use that there. + isX86Darwin = system: system == "x86_64-darwin"; + in inputs.flake-parts.lib.mkFlake {inherit inputs;} { systems = import inputs.systems; imports = [ (inputs.import-tree ./flake) ./modules ]; + perSystem = {system, ...}: { + _module.args.pkgs = + if isX86Darwin system + then inputs."nixpkgs-2605".legacyPackages.${system} + else inputs.nixpkgs.legacyPackages.${system}; + }; }; inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + "nixpkgs-2605".url = "github:NixOS/nixpkgs/nixpkgs-26.05-darwin"; flake-parts.url = "github:hercules-ci/flake-parts"; systems.url = "github:nix-systems/default"; devshell = { diff --git a/flake/devshells.nix b/flake/devshells.nix index 71946cb..f04e22e 100644 --- a/flake/devshells.nix +++ b/flake/devshells.nix @@ -21,10 +21,15 @@ }; packages = lib.attrsets.attrValues { + # apm-cli isn't in nixpkgs-26.05-darwin (x86_64-darwin); + # run the same PyPI release ephemerally via uv there. + apm-cli = + pkgs.apm-cli or (pkgs.writeShellScriptBin "apm" '' + exec ${pkgs.uv}/bin/uv tool run --from apm-cli apm "$@" + ''); inherit (pkgs) android-tools - apm-cli cargo clippy pkg-config From 72b930af6fb33581e3b44ead953aedbc686cddbd Mon Sep 17 00:00:00 2001 From: Divit Mittal <64.69.76.69.74.m@gmail.com> Date: Thu, 22 Oct 2026 16:38:08 +0530 Subject: [PATCH 2/3] chore(git): ignore in-project .worktrees directory --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index c73d35a..d6b0229 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,6 @@ apm_modules/ AGENTS.md CLAUDE.md GEMINI.md + +## git worktrees kept inside the project directory +.worktrees/ From 5c1b62ff546baf2e487056009f9781479f8e98ea Mon Sep 17 00:00:00 2001 From: Divit Mittal <64.69.76.69.74.m@gmail.com> Date: Fri, 23 Oct 2026 00:51:35 +0530 Subject: [PATCH 3/3] fix(nix): pin nix-systems to keep x86_64-darwin outputs nix-systems/default removed x86_64-darwin from its list upstream (c29398b5). Pin systems to da67096a, the last revision that still lists it, so a relock can't drop this flake's x86_64-darwin outputs. --- flake.lock | 1 + flake.nix | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/flake.lock b/flake.lock index c9e9e20..92db470 100644 --- a/flake.lock +++ b/flake.lock @@ -210,6 +210,7 @@ "original": { "owner": "nix-systems", "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "type": "github" } }, diff --git a/flake.nix b/flake.nix index ce1cfa0..288ce88 100644 --- a/flake.nix +++ b/flake.nix @@ -24,7 +24,9 @@ nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; "nixpkgs-2605".url = "github:NixOS/nixpkgs/nixpkgs-26.05-darwin"; flake-parts.url = "github:hercules-ci/flake-parts"; - systems.url = "github:nix-systems/default"; + # nix-systems/default dropped x86_64-darwin in c29398b5; pin the last + # revision that still lists it so lock bumps keep x86_64-darwin outputs. + systems.url = "github:nix-systems/default/da67096a3b9bf56a91d16901293e51ba5b49a27e"; devshell = { url = "github:numtide/devshell"; inputs.nixpkgs.follows = "nixpkgs";