nixpkgs/upstart-jobs/nix-daemon.nix
Eelco Dolstra f6fd10cbd8 * Support for system-wide distributed / multi-platform builds.
Just set nix.distributedBuilds to true and nix.buildMachines 
  to a list of machines that can perform Nix builds via SSH,
  and local builds will be forwarded appropriately.  So now
  any user can say something like

    nix-build /etc/nixos/nixpkgs/ --arg system '"powerpc-linux"' -A libxml2

  and the build for powerpc-linux will be forwarded to a machine 
  of that type.

svn path=/nixos/trunk/; revision=9696
2007-11-15 17:16:16 +00:00

18 lines
364 B
Nix

{config, pkgs, nix, nixEnvVars}:
{
name = "nix-daemon";
job = "
start on startup
stop on shutdown
respawn
script
export PATH=${if config.nix.distributedBuilds then "${pkgs.openssh}/bin:" else ""}${pkgs.openssl}/bin:${nix}/bin:$PATH
${nixEnvVars}
exec ${nix}/bin/nix-worker --daemon > /dev/null 2>&1
end script
";
}