Skip to content

Commit

Permalink
trick nix and devenv into building x86 packages
Browse files Browse the repository at this point in the history
  • Loading branch information
sandydoo committed Feb 20, 2025
1 parent 916b909 commit 6dc6c76
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion agents/macos.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
githubOrganization = "cachix";
namePrefix = "cachix-x86_64-darwin-rosetta-";
tokenFile = config.age.secrets.github-runner-token.path;
extraPackages = [ pkgs.devenv ];
extraPackages = [ pkgs.devenv-x86 ];
};
};

Expand Down
2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
cachix = cachix-flake.packages.${system}.default;
devenv = devenv.packages.${system}.devenv;
unstable = nixpkgs-unstable.legacyPackages.${system};
} // lib.optionalAttrs (system == "aarch64-darwin") {
devenv-x86 = devenv.packages.x86_64-darwin.devenv;
})
];
};
Expand Down
10 changes: 5 additions & 5 deletions modules/github-runner.nix
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,11 @@ in
];
}
(lib.mkIf cfg.rosetta.enable {
package =
let
wrapX86Program = pkgs.callPackage ../lib/wrap-x86-program.nix { };
in
wrapX86Program pkgs.pkgsx86_64Darwin.github-runner;
extraEnvironment = {
"NIX_USER_CONF_FILES" = "${pkgs.writeText "x86-nix-user-conf" ''
system = x86_64-darwin
''}";
};
})
(lib.mkIf pkgs.stdenv.isLinux { user = runnerName; })
cfg.extraService
Expand Down

0 comments on commit 6dc6c76

Please sign in to comment.