[Nix-dev] nixops virtualbox disk size

Joel Moberg joel.moberg at gmail.com
Tue Jun 16 22:24:19 CEST 2015


You are going to have to build a custom image I think, maybe you can use
the prebuilt, and resize it, look futher down the page here
https://github.com/NixOS/nixops/blob/master/nix/virtualbox.nix#L132 . It
looks like the main disk have to be on port 0. So if you would have
virtualbox.disks.disk1 = { port=0;
baseImage="${pkgs.richards-image}/image-name.vdi";
};

If you build a custom image, I think the command is something along:
nix-build ~/nixpkgs-repo/nixos/release.nix -A
config.system.build.virtualBoxImage -I nixos-config=path-to-nixos-config

But the best is maybe to create a declaration for this, then you can look
more into nixos/release.nix and modules ... virtualbox.nix.

On Tue, Jun 16, 2015 at 9:12 PM, Richard Wallace <
rwallace at thewallacepack.net> wrote:

> Unfortunately, that just creates an additional disk and is not used as the
> root partition or for the /nix/store. If I could figure out how to get it
> used for either of those that option would work great, but I haven't been
> able to do that yet.
>
> On Tue, Jun 16, 2015 at 12:06 PM, Joel Moberg <joel.moberg at gmail.com>
> wrote:
>
>> I don't use nixops but after looking in the repo i found this:
>> https://github.com/NixOS/nixops/blob/master/nix/virtualbox.nix#L42
>>
>> So it should be: virtualbox.disks.mydisk = { port=1; size=123123123; };
>>
>> Hope this works.
>>
>> On Tue, Jun 16, 2015 at 8:56 PM, Richard Wallace <
>> rwallace at thewallacepack.net> wrote:
>>
>>> Where should that be configured? In the examples in the manual <
>>> https://nixos.org/nixops/manual/#idm140737319351408> I tried adding it
>>> in trivial.nix as 'virtualbox.baseImageSize = "50G";' and tried adding it
>>> to trivial-vbox.nix as 'deployment.virtualbox.baseImageSize = "50G";' and
>>> neither seemed to have an affect.
>>>
>>> On Tue, Jun 16, 2015 at 11:25 AM, Joel Moberg <joel.moberg at gmail.com>
>>> wrote:
>>>
>>>> There is, config.virtualbox.baseImageSize, defined here:
>>>>
>>>> https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/vir
>>>> tualbox-image.nix#L13
>>>> <https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/virtualbox-image.nix#L13>
>>>>
>>>> _______________________________________________
>>>> nix-dev mailing list
>>>> nix-dev at lists.science.uu.nl
>>>> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>>>>
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20150616/26bc63db/attachment-0001.html 


More information about the nix-dev mailing list