[Nix-dev] Put configuration.nix under version control

Profpatsch mail at profpatsch.de
Thu Jan 21 19:48:26 CET 2016


On 16-01-20 06:24pm, Owen Lynch wrote:
> Hello,
> 
> I'm wondering if there is a standard/recommended way to put
> /etc/nixos/configuration.nix under version control. It would make managing
> lots of virtual machines a lot easier, because I could have a script that
> updated to the latest configuration.nix and then ran nixos-rebuild whenever
> I made a change. It would also make updates even *more* atomic!

Don’t forget that you can symlink that file.
I used to symlink it from my homefolder for example, so I could
edit the system configuration without administrator privileges.

A good idea is to create one repository and make different configurations
just module files that can be loaded with a minimal configuration.nix, like
vuizvui does it. https://github.com/openlab-aux/vuizvui

The configuration.nix then only looks like this:
(import <vuizvui/machines> {}).labnet.labtop.config

-- 
Proudly written in Mutt with Vim on NixOS.
Q: Why is this email five sentences or less?
A: http://five.sentenc.es
May take up to five days to read your message. If it’s urgent, call me.


More information about the nix-dev mailing list