2016-07-18 10 views
1

Ich kann sehen, dass NixOS diese Versionen verfügbar für die Installation hat:NixOS installieren spezifische NodeJS Version

... 
nodejs-0.10-statsd-0.7.2 
nodejs-0.10.42 
nodejs-4.3.1 
nodejs-5.9.0 
... 

noch systemPackages mag es nicht mich zu installieren nodejs-5.9.0 wie es beklagt, dass:

error: syntax error, unexpected INT, expecting ID or OR_KW or DOLLAR_CURLY or '"', at /etc/nixos/configuration.nix:49:14 
(use ‘--show-trace’ to show detailed location information) 
error: syntax error, unexpected INT, expecting ID or OR_KW or DOLLAR_CURLY or '"', at /etc/nixos/configuration.nix:49:14 
(use ‘--show-trace’ to show detailed location information) 
building the system configuration... 
error: syntax error, unexpected INT, expecting ID or OR_KW or DOLLAR_CURLY or '"', at /etc/nixos/configuration.nix:49:14 
(use ‘--show-trace’ to show detailed location information) 

was darauf hindeutet, zu mir mache ich etwas falsch. Ich würde lieber nicht einfach mit nix-env -i ... installieren, weil ich es systemweit wollen (und ich baue meine Standard-NixOS-Konfiguration für alle meine Dev-Maschinen).

Nach der nixpkgs repository v6 ist verfügbar, aber ich habe keine Ahnung, wie man nixos-rebuild durch configuration.nix oder sonst wie es zu installieren.

Wie kann ich das richtig konfigurieren, damit ich die neueste Version von NodeJS oder speziell 5.9.0 installieren kann?

Antwort

3

Es stellte sich heraus, dass es möglich war, aber ich verwendete den falschen Paketnamen. Wenn Sie mit nix-env -qaP | grep nodejs Abfrage erhalten Sie den Namen von seinem Namensraum:

$ nix-env -qaP | grep nodejs 
nixos.statsd               nodejs-0.10-statsd-0.7.2 
nixos.nodejs-0_10              nodejs-0.10.42 
nixos.nodejs               nodejs-4.3.1 
*nixos.nodejs-5_x              nodejs-5.9.0* 
nixos.azure-cli              nodejs-azure-cli-0.9.15 
nixos.dnschain              nodejs-dnschain-0.5.3 
nixos.groovebasin              nodejs-groovebasin-1.5.1 
nixos.keybase               nodejs-keybase-0.8.25 
nixos.npm2nix               nodejs-npm2nix-5.12.0 
nixos.pumpio               nodejs-pump.io-git-2015-11-09 
nixos.ripple-rest              nodejs-ripple-rest-1.7.0-rc1 
nixos.shout               nodejs-shout-0.51.1 
nixos.sloc               nodejs-sloc-0.1.9 
nixos.wring               nodejs-wring-1.0.0 

I NodeJS-5.9.0 speziell wollten, was bedeutet, ich brauche das nodejs-5_x Paket zu verwenden, wie oben (Hervorhebung von mir) beschrieben.