summaryrefslogtreecommitdiffhomepage
path: root/flake.nix
diff options
context:
space:
mode:
authorCaleb Norton <[email protected]>2026-01-18 21:46:00 -0600
committerGitHub <[email protected]>2026-01-18 21:46:00 -0600
commit2fc4ab9687219aae4cef5fba042264f7638c5ebc (patch)
treeb69ae3f464b7a1b79f3682e6f22606fcf9de6efc /flake.nix
parentd939a3ad547f1794ab39a5455517bedfc310f286 (diff)
downloadopencode-2fc4ab9687219aae4cef5fba042264f7638c5ebc.tar.gz
opencode-2fc4ab9687219aae4cef5fba042264f7638c5ebc.zip
ci: simplify nix hash updates (#9309)
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix24
1 files changed, 22 insertions, 2 deletions
diff --git a/flake.nix b/flake.nix
index 20833fc49..0f4250937 100644
--- a/flake.nix
+++ b/flake.nix
@@ -33,17 +33,37 @@
packages = forEachSystem (
pkgs:
let
- opencode = pkgs.callPackage ./nix/opencode.nix {
+ node_modules = pkgs.callPackage ./nix/node_modules.nix {
inherit rev;
};
+ opencode = pkgs.callPackage ./nix/opencode.nix {
+ inherit node_modules;
+ };
desktop = pkgs.callPackage ./nix/desktop.nix {
inherit opencode;
};
+ # nixpkgs cpu naming to bun cpu naming
+ cpuMap = { x86_64 = "x64"; aarch64 = "arm64"; };
+ # matrix of node_modules builds - these will always fail due to fakeHash usage
+ # but allow computation of the correct hash from any build machine for any cpu/os
+ # see the update-nix-hashes workflow for usage
+ moduleUpdaters = pkgs.lib.listToAttrs (
+ pkgs.lib.concatMap (cpu:
+ map (os: {
+ name = "${cpu}_${os}_node_modules";
+ value = node_modules.override {
+ bunCpu = cpuMap.${cpu};
+ bunOs = os;
+ hash = pkgs.lib.fakeHash;
+ };
+ }) [ "linux" "darwin" ]
+ ) [ "x86_64" "aarch64" ]
+ );
in
{
default = opencode;
inherit opencode desktop;
- }
+ } // moduleUpdaters
);
};
}