[Nix-dev] nixops - nix-channel per machine

Tomas Hlavaty tomas.hlavaty at knowledgetools.de
Mon Jul 27 13:03:09 CEST 2015


Hi Rob & Nicolas,

thank you for your suggestions.

The option -I nixpkgs=/path/to/your/nixpkgs sets the nixpkgs "globally"
for nixops.  That is not what I need.

I have tried using nixops set-attrs, but that is also doesn't allow me
to use stable for one machine and unstable for the other.

Maybe this could work if I created two separate networks depending on
nixpks.  But this is not a nice workaround.

It looks like the module suggestion might be what I need but that gives
me an error:

   error: Module `foo/configuration.nix' has an unsupported attribute
   `boot'. This is caused by assignments to the top-level attributes
   `config' or `options'.  (use ‘--show-trace’ to show detailed location
   information) error: evaluation of the deployment specification failed

It seems that I am not allowed to change that.  Moreover, it doesn't
seem to be the same as specifying a different nixos-channel.

What I need is something like:

test-logical.nix:

{
  network.description = "test network";
  foo = with-stable-channel ./foo/configuration.nix;
  bar = with-unstable-channel ./bar/configuration.nix;
}

Is there a way to achieve that?

Thanks a lot!

Tomas

Nicolas Pierron <nicolas.b.pierron at gmail.com> writes:

> Otherwise, if you are using the latest master of NixOS, then you
> should be able to define which set of packages you are interested in
> within the module system, while using the modules from the latest
> NixOS.
>
> { config, lib, ... }:
>
> {
>   config = {
>     _module.args.pkgs = lib.mkForce (import <my-nixpkgs> {
>       inherit (config.nixpkgs) system config;
>     });
>   };
> }
>
>
> On Fri, Jul 24, 2015 at 5:56 PM, Rob Vermaas <rob.vermaas at gmail.com> wrote:
>> Hi Tomas,
>>
>> you can use -I nixpkgs=/path/to/your/nixpkgs when using nixops. You
>> can also make it persistent using 'nixops create/modify', the nix path
>> will be stored in the nixops database, and you can inspect it with
>> 'nixops info'.
>>
>> Cheers,
>> Rob
>>
>> On Fri, Jul 24, 2015 at 3:10 PM, Tomas Hlavaty
>> <tomas.hlavaty at knowledgetools.de> wrote:
>>> Hi,
>>>
>>> in nixops, how can i specify a nix-channel per machine?  Or any other
>>> way to have different machines running different versions of nixos?
>>>
>>> Thank you,
>>>
>>> Tomas
>>> _______________________________________________
>>> nix-dev mailing list
>>> nix-dev at lists.science.uu.nl
>>> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>>
>>
>>
>> --
>> Rob Vermaas
>>
>> [email] rob.vermaas at gmail.com
>> _______________________________________________
>> nix-dev mailing list
>> nix-dev at lists.science.uu.nl
>> http://lists.science.uu.nl/mailman/listinfo/nix-dev


More information about the nix-dev mailing list