Cross Compiling: Difference between revisions

imported>Symphorien
add an example shell file
imported>Samueldr
Line 13: Line 13:
== How to obtain a shell with a cross compiler ==
== How to obtain a shell with a cross compiler ==
Create a file as follows:
Create a file as follows:
{{file|crossShell.nix|nix|<nowiki>
<syntaxhighlight lang="nix">
with import <nixpkgs> {
with import <nixpkgs> {
   crossSystem = {
   crossSystem = {
Line 23: Line 23:
   buildInputs = [ zlib ]; # your dependencies here
   buildInputs = [ zlib ]; # your dependencies here
}
}
</nowiki>}}
</syntaxhighlight>
and then use it to obtain a shell:
and then use it to obtain a shell:
{{commands|nix-shell crossShell.nix}}
{{commands|nix-shell crossShell.nix}}