[Nix-dev] nixops - nix-channel per machine
Tomas Hlavaty
tomas.hlavaty at knowledgetools.de
Mon Jul 27 13:50:57 CEST 2015
I got the _module.args.pkgs to (almost) work but I think it somehow
mixes up the two nixpkgs versions (running on unstable, overriding
_module.args.pkgs to stable):
error: attribute ‘ipset’ missing, at
/nix/store/fdv2bhnjgdanr87wjqa7rbbm5gf6k4hr-nixos-15.06pre65267.6ad8fab/nixos/nixpkgs/nixos/modules/services/networking/firewall.nix:446:50
Tomas
Tomas Hlavaty <tomas.hlavaty at knowledgetools.de> writes:
> 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