10

I've got a NixOS box on the nixos-16.03 channel. I want the machine to stay in a stable state, and so I avoid switching to nixos-unstable.

I need to install a newer version of a package than is available in that channel (nodejs-6_x). In the manual, there is a section that describes One-Click Installation, which seemed at first like exactly what I needed. The Hydra server at http://hydra.nixos.org doesn't appear to be serving up any .nixpkg files which are used by the nix-install-package tool described in that section.

The wiki also documents a process by which one can customize a package (the page is called Modifying Packages), which could be used for my purposes, although it seems like I'd be fighting the tool rather than using it.

In IRC, M-Ralith advised to "override src and version in your nixpkgs config", which sounds like I could write a nix expression in .nixpkgs/configuration.nix and override those properties for the package in my subscribed channel (nixos-16.03). When I asked about packages that don't exist in the channel, the advice was "to specify the entire package rather than just overriding src and version", which I take to mean that I would need to duplicate the entire nix expression for the package I'm interested in. It seems to me that this would have the effect of preventing nix-env from ever updating that package should the stable channel catch up or overtake the version that I use to override.

For packages that exist in another channel that I want to install, but stay on my current channel, is there a better way? It almost feels like I should be able to do something like nix-build <url> | nix-env -i. What would be ideal is to install this one off, but not have configuration that might prevent it from being upgraded later on if my current channel were to catch up.

1 Answer 1

8

you can use nix-env tool

% nix-env -f https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz -iA tig 

or use nix-build tool

% nix-build -I nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz -A tig 

how that helps!

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.