Nix on ARM: Difference between revisions

imported>Jtojnar
m do not use pkgconfig alias
m Reverted edit by Klinger (talk) to last revision by Mic92
Tag: Rollback
 
(8 intermediate revisions by 5 users not shown)
Line 1: Line 1:
== Initial ==
This wiki section concerns the nix package manager tool only. Information about Arm based NixOS systems can be found here: [[NixOS_on_ARM]]
 
Both aarch64 and armv7l are tested and working. Though, aarch64 is the only arm architecture which is officially supported and has binary packages available from the official nixos cache. Therefore it is highly recommended to use the aarch64 version of nix if your platform and OS support it. For example on Raspberry OS, aarch64 support [https://www.raspberrypi.org/forums/viewtopic.php?t=250730 can be enabled easily].
 
==aarch64==
Since aarch64 is officially supported, nix can be installed the official way
<code>curl -L https://nixos.org/nix/install | sh</code>
For more information see: [https://nixos.org/download.html Getting Nix]
 
== armv7l ==
A prebuilt nix installer for armv7l, including instruction on how to build it yourself using docker, can be found here: [https://github.com/DavHau/nix-on-armv7l github.com/DavHau/nix-on-armv7l]
 
For some more information on, for example, community maintained binary caches, check also: [[NixOS_on_ARM]]


In case this helps anyone - by modifying Nix's `release.nix` you can make your own ARMv7 installer.
In case this helps anyone - by modifying Nix's `release.nix` you can make your own ARMv7 installer.
 
(This is outdated and doesn't work anymore. At least not without additional modifications)
Here's a prebuilt version: [https://tomberek.info/nix-2.0pre0_0000000-armv7l-linux.tar.bz2 Nix Installer]


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
{ nix ? builtins.fetchGit ./.
{ nix ? builtins.fetchGit ./.
, nixpkgs ? <nixpkgs> #builtins.fetchGit { url = https://github.com/NixOS/nixpkgs-channels.git; ref = "nixos-18.03"; }
, nixpkgs ? <nixpkgs> #builtins.fetchGit { url = https://github.com/NixOS/nixpkgs.git; ref = "nixos-18.03"; }
, officialRelease ? false
, officialRelease ? false
, systems ? [ "armv7l-linux" ]
, systems ? [ "armv7l-linux" ]
Line 26: Line 37:
       releaseTools.sourceTarball {
       releaseTools.sourceTarball {
         name = "nix-tarball";
         name = "nix-tarball";
         version = builtins.readFile ./version;
         version = builtins.readFile ./.version;
         versionSuffix = if officialRelease then "" else "pre${toString nix.revCount}_${nix.shortRev}";
         versionSuffix = if officialRelease then "" else "pre${toString nix.revCount}_${nix.shortRev}";
         src = nix;
         src = nix;
         inherit officialRelease;
         inherit officialRelease;


         buildInputs = tarballDeps ++ buildDeps;
         buildInputs = tarballDeps ++ buildDeps ++ propagatedDeps;


         configureFlags = "--enable-gc";
         configureFlags = "--enable-gc";
Line 74: Line 85:


         buildInputs = buildDeps;
         buildInputs = buildDeps;
        propagatedBuildInputs = propagatedDeps;


         configureFlags = configureFlags ++
         configureFlags = configureFlags ++
Line 196: Line 208:


         buildInputs = buildDeps;
         buildInputs = buildDeps;
        propagatedBuildInputs = propagatedDeps;


         configureFlags = ''
         configureFlags = ''