[Nix-dev] --argstr system i686-linux in nixos

Lluís Batlle viriketo at gmail.com
Sat May 16 13:40:54 CEST 2009


Hello,

I have at work a fast nixos machine (x86_64-linux) which can build
nixos store paths for my slow home computer (i686-linux).

I changed the nixos/default.nix to allow me choosing the system on a
nix-build call:
---------------
{ platform ? builtins.currentSystem }:
let

  fromEnv = name: default:
    let env = builtins.getEnv name; in
    if env == "" then default else env;
  configuration = import (fromEnv "NIXOS_CONFIG" /etc/nixos/configuration.nix);
  nixpkgs   =         fromEnv "NIXPKGS"      /etc/nixos/nixpkgs;
  system = import system/system.nix { inherit configuration nixpkgs platform; };
---------------
This may not be very pretty to commit upstream, but it works for me.

Maybe I missed a feature of --argstr, which would allow me to set the
value of the default parameter of "import system/system.nix" without
adding these new lines about "platform"?

Regards,
Lluís.



More information about the nix-dev mailing list