Skip to content

Instantly share code, notes, and snippets.

@ajmcmiddlin
Created December 20, 2017 05:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajmcmiddlin/63a0ea1a75501734f239c23461efc3f1 to your computer and use it in GitHub Desktop.
Save ajmcmiddlin/63a0ea1a75501734f239c23461efc3f1 to your computer and use it in GitHub Desktop.
{ nixpkgsFun ? <nixpkgs>, compiler ? "default", cross ? "" }:
let
pkgs = import nixpkgsFun {};
rpi = pkgs.lib.systems.examples.raspberryPi;
localSystem = pkgs.lib.systems.elaborate { system = builtins.currentSystem; };
crossSystem = if cross == "pi1" then rpi
else if cross == "" then null
else throw "Unknown cross target: " ++ cross;
pkgsCross = import nixpkgsFun { inherit localSystem crossSystem; };
in
pkgsCross.hello
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment