4 ms·
Definitely - I've been doing this for about five years with all my machines. A rough overview of the setup: - A public repository with a Nix configuration file
by l0b0 7y ago
Definitely - I've been doing this for about five years with all my machines. A rough overview of the setup:
- A public repository with a Nix configuration file: https://gitlab.com/victor-engmark/root https://gitlab.com/victor-engmark/root. This does the global setup, installing applications, configuring global services, enabling hardware, etc, and gets me 90% of the way to identical machines with a single `nixos-rebuild switch`.
- A public repository with dotfiles and main application configuration: https://gitlab.com/victor-engmark/tilde https://gitlab.com/victor-engmark/tilde. Allows me to configure user applications once for all my machines.
- A private repository with secrets such as SSH keys and host-specific configuration like video drivers, screen layout etc.
This makes it possible to get from a fresh OS install to a developer workstation with everything from keyboard layout to my favourite window manager configured as I like it within minutes.
I consider learning configuration management a nice bonus of this setup, but of course that is not for everyone.
The biggest problem with this is how many programs seem to go out of their way to make their configuration hard to version control. Firefox moved to SQLite for everything years ago, but at least there's the Sync service. Some applications reorder configuration items every time they save (I've built scripts to order them properly). And others include things which IMO don't belong in "user" configuration files such as window size, recently opened files and which configuration tab was last open.
PS: I recently moved to Nix on NixOS from Puppet (similar features to Ansible and Chef) on Arch Linux for the system configuration. Nix has several massive advantages over at least Puppet and Ansible, both of which I've used a fair bit:
- Much shorter configuration. For example, `services.fail2ban.enable = true;` is enough to install, enable and start a fail2ban service when building the configuration, and `time.timeZone = "Pacific/Auckland";` means I don't have to even think about where that piece of configuration is stored, or in which of the infinite formats used for Linux configuration.
- Trivial rollback to earlier configurations, during runtime or at the boot menu. This saved my backside when I screwed up a GRUB-related setting - just reboot and select the previous configuration.
- You can install applications as a non-root user to try them out.
- I've been using Nix for less than a month, but it's far easier to just get stuff done with it than with Puppet or Ansible, and the end results so far are just generally nicer.
So if you want a simple system configuration you can copy around to configure everything the same way I would thoroughly recommend NixOS.