[Nix-dev] How do you manage bare-metal local servers with nixops

zimbatm zimbatm at zimbatm.com
Tue Dec 15 01:19:12 CET 2015


Rohit, try something like this:
https://gist.github.com/zimbatm/d466ef56f88605f78f99

On Mon, 14 Dec 2015 at 22:47 Domen Kožar <domen at dev.si> wrote:

> You might want to test https://github.com/NixOS/nixpkgs/pull/11279
>
> On Mon, Dec 14, 2015 at 10:45 PM, rohit yadav <rohityadav7787 at gmail.com>
> wrote:
>
>> Hi Zimbatm,
>>
>> I have very similar arrangement. I use git and to keep the configuration
>> synced. However, I wish to use NixOps, I haven't been able to find time to
>> do that. From the documentation I could not figure out how to deploy on
>> bare-metal. But as Christoph mentioned that a simple Ip-Address in the
>> network is all you need with nixops do deploy. It will remove lot of boiler
>> plate configuration I have to write on each system.
>>
>> Thanks,
>> Rohit
>>
>> On Mon, Dec 14, 2015 at 3:33 PM, zimbatm <zimbatm at zimbatm.com> wrote:
>>
>>> Hi rohit,
>>>
>>> Personally I just have a folder per machine with the /etc/nixos folder
>>> and a little script that runs rsync + `nixos-rebuild --switch` on the
>>> target machine.
>>>
>>> Over time I will probably switch to using nixops as well but for a start
>>> it's working super well for me. Especially since it doesn't have any nix
>>> dependency on the source machine. It takes just a couple of seconds to
>>> deploy which is way better than anything I had in the past (ansible,
>>> puppet, capistrano, ...).
>>> On Thu, 10 Dec 2015 20:45 Christoph Hrdinka <c.nix-dev at hrdinka.at>
>>> wrote:
>>>
>>>> Hi Rohit!
>>>>
>>>> You can use nixops to deploy to any server running ssh. All you have to
>>>> do is install a basic NixOS system with opensshd enabled on your target
>>>> server. Then tell nixops the hostname/ip address of the new server
>>>> via `deployment.targetHost`.
>>>>
>>>> Nixops will evaluate any nix expression you give it. If you supply
>>>> multiple files these will be merged. Your nix expression must yield an
>>>> attribute set of the following form:
>>>>
>>>> {
>>>>   someMachineName =
>>>>     { config, lib, pkgs, ... }:
>>>>     {
>>>>       deployment.targetHost = "hostname or ip";
>>>>       # your usual nixos configuration file
>>>>       # ...
>>>>     }
>>>>
>>>>   anotherMachine =
>>>>     {....}
>>>> }
>>>>
>>>> Every machine described in there will be deployed according to your
>>>> configuation. Since it is a normal nix expression you can use any way
>>>> to produce it. You can have basic templates that will be merged and
>>>> overwritten by more specific ones, write everything in one file, spread
>>>> it over hundret files or write a configuration syntax from which nix
>>>> will derive all actual server configs.
>>>>
>>>> For what exactly do you need PXE? Is it for the initial NixOS install
>>>> or do you want to use it because it worked for you till now with other
>>>> systems?
>>>> If you want it because of less configuration work it may be the wrong
>>>> tool for a NixOS setup. Nixops is much better suited for this job than
>>>> any PXE setup could ever be. It is made for simple deployment of
>>>> hundrets of machines.
>>>>
>>>> You might also want to have a look at disnix/disnixos.
>>>>
>>>> Regards,
>>>> Christoph Hrdinka.
>>>> _______________________________________________
>>>> nix-dev mailing list
>>>> nix-dev at lists.science.uu.nl
>>>> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>>>>
>>>
>>> _______________________________________________
>>> nix-dev mailing list
>>> nix-dev at lists.science.uu.nl
>>> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>>>
>>>
>>
>> _______________________________________________
>> nix-dev mailing list
>> nix-dev at lists.science.uu.nl
>> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>>
>>
> _______________________________________________
> 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/20151215/edeb2959/attachment-0001.html 


More information about the nix-dev mailing list