Skip to content

Instantly share code, notes, and snippets.

@noamraph
Created August 24, 2023 12:15
Show Gist options
  • Save noamraph/b88f91e8f300d8d77f1f3d7069a9358d to your computer and use it in GitHub Desktop.
Save noamraph/b88f91e8f300d8d77f1f3d7069a9358d to your computer and use it in GitHub Desktop.
Nix: Cross-compile Hello World for mips64r6el
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1692698134,
"narHash": "sha256-YtMmZWR/dlTypOcwiZfZTMPr3tj9fwr05QTStfSyDSg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a16f7eb56e88c8985fcc6eb81dabd6cade4e425a",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}
# Note: build with: NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix build --impure
{
description = "Build Hello World on mips64r6el";
inputs.nixpkgs.url = github:NixOS/nixpkgs/nixos-23.05;
outputs = { self, nixpkgs }: {
defaultPackage.x86_64-linux =
(import nixpkgs { system = "x86_64-linux"; crossSystem = { config = "mipsisa64r6el-linux-gnuabi64"; }; }).pkgsStatic.hello;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment