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/ diff --git a/flake.lock b/flake.lock index fe944b7..92db470 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" } @@ -193,6 +210,7 @@ "original": { "owner": "nix-systems", "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "type": "github" } }, diff --git a/flake.nix b/flake.nix index 20e2fc9..288ce88 100644 --- a/flake.nix +++ b/flake.nix @@ -1,19 +1,32 @@ { 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"; + # 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"; 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