Live data from Hacker News

Ask HN: Configuration Management for Personal Computer?

news.ycombinator.com

121–130 of 144 posts

Re: Ask HN: Configuration Management for Personal Computer?

#121
I currently use a mix of SaltStack in masterless mode (for system-wide configuration) and Makefile (for user-specific configuration), both in the same git repository, and it handles pretty much everything fine, including idempotency.

The thing is, it doesn't age well: it works for me because I take care of it on a regular basis but it probably wouldn't help much a few years from now if left unmaintained.

-*-

I started using SaltStack in masterless mode 5 years ago, and I won't be looking back. It handles both packet installation and consistent system-wide configuration. It was perfect for a single desktop computer running Kubuntu at the time, and it's perfect now for 9 different computers (servers, desktops and laptops) with widely different hardware specs, 3 different distros (Debian, Kubuntu and Arch) and very different use cases (servers, gaming stations and family computers).

The Makefile is an idempotent replacement for a shell script I wrote for NetBSD 15 years ago. It handles user configuration and works on pretty much all OSes I use (including Windows, Solaris and AIX) without requiring a root / admin account.

With this mix, I can setup a new computer with a known distro in a few minutes: setting the hostname, selecting the profile (server, gaming…) and the list of users which will get access to it. Installing on a new distro (including an upgraded version of a known distro) usually requires a few tweaks, so it can take up to a few hours to get everything working — that's still way better than spending weeks or months for some inconsistent and buggy result, but keep this in mind if new distros is the only scenario you're interested in.

I don't migrate data: I prefer having as little as possible on each individual computer.

Re: Ask HN: Configuration Management for Personal Computer?

#122

I consider this problem to be similar to moving homes. When you move, you discover a bunch of stuff that you are no longer using and this presents an opportunity to get rid of those things. You also discover things that you have not been using for a while but now that you are reminded, you would like to start using again. In any case, a move can to be a mindful activity that results in a better setup for you in your…

The Minimalists movement talks about this a lot. The idea is that you pack everything you own into labeled boxes and for 3 months, every time you need X you first think about if you really need X or not, and if you do you unpack. After 3 months you throw out everything that is still packed. For this reason every few months I start with a clean OS install and for a few days I add what I need, while also taking some ti…

I'll bet there are very little minimalist wood and metalworkers then. Tools tend to get used infrequently, a couple of times per year, if that. But when you need them, you need them badly.

Re: Ask HN: Configuration Management for Personal Computer?

#123

I think overall its a mistake to try to over automate this process. It's brittle and the requirements are simply not the same as a server environment that needs to be simple to replicate X versions quickly, repeatedly and frequently. Automation needs fairly constant attention in the order of little tweaks week over week to fight the inevitable mismatch between the automation and the software networks that it interfac…

I had a period where I _did_ reimage my machine every week. Keeping it running productively wasn't that bad - data was kept on a separate drive from the OS, and a script was used (as a post-reimage step) to reinstall all the apps I used and link all the data folders (and config files and profiles) into place. For me for Windows, that meant having a powershell script that used a combination of chocolatey (to install what was available via package manager in that way) and saved installers run from the command line in quiet mode (plus a bunch of link commands).

The only real drain is that you need to remember when you install a new app that you need to add it to your script. Beyond that, simply keeping most non-application data on a drive that didn't get reimaged with the OS (and could store things that could be linked into the system drive) handled a lot.

Re: Ask HN: Configuration Management for Personal Computer?

#124
You can get 99% of what configuration management does by just building a configuration package.

1. If you want an application installed, list it as a dependency of your configuration package.

2. If you want a configuration file installed, put it in your configuration package.

3. If you want a user account or group, put a config file for systemd-sysusers in your configuration package.

I built a tool that simplifies package building for this particular purpose, where you're just listing dependencies and file contents: https://github.com/holocm/holo-build - As an example, this is the configuration package for my notebook: https://github.com/majewsky/system-configuration/blob/418282...

The nice thing about this approach, compared to switching to something like NixOS, is that you can continue to use your favorite distribution. However, when you go by this route, you will run into a brick wall very fast because you cannot install a configuration file into a path where an application package already installed an example config. I built http://holocm.org for this purpose. It works well enough, even though it has a few quirks at times. It's fundamentally limited by the system package manager having the final say in everything.

Since January, I've been slowly migrating my servers to NixOS. The desktop and the notebook might follow at some point. NixOS certainly has enough quirks on its own, but at last the configuration management is a first-class citizen on my servers.

Re: Ask HN: Configuration Management for Personal Computer?

#125
post #88
post #86

Earlier quoted context omitted.

> NixOS can be helpful here, by making all of the non-user-specific stuff completely reproducible How is this different from say Debian's "apt" package manager? You can specifically reproduce the system by downloading all versions of the packages you have, right?

Consider reading the NixOS documentation if you would like to learn more, because it’s worth it imo, but no, Debian is a different case. NixOS doesn’t just manage packages, it manages the entire system holistically. You effectively have a single configuration file (or multiple) that configure every package, service, mount, ramdisk, driver, etc. If I delete everything but my home folder, my configuration file can be u…

I share a NixOS config setup with my brother. It’s been evolving since 2015. He recently got a new laptop after using Mac for a year, cloned our repo, and was up and running. It really makes the computer feel like a commodity and the configuration like a sharable durable trackable artifact.

Re: Ask HN: Configuration Management for Personal Computer?

#127
post #2

I used a bash script with homebrew to reimage my MacBook fresh. With cask I can get almost every app I need and reinstate python and necessary packages. As you're working on the command line you can also modify most settings with defaults.write. I'm sure there is something similar you can do with windows and Linux.

I do the same. For me it's as simple as installing ~5 homebrew packages (I can get the same packages for my Linux machines), the Opera browser, and a copy of .bash_profile and .vimrc, which I keep in a Github repo. Having to migrate machines has made me trim down my development toolset significantly. I now know exactly what I need, and can go from fresh machine to the environment I'm accustomed to working with in < 1…

Yep and you know a shell will be on whatever device you want. I've even got it tightly ordered so it creates an SSH key, waits for me to go to GitHub and then I resume and it pulls all my repos down along with dot files.

Re: Ask HN: Configuration Management for Personal Computer?

#128
I use archiso and a number of custom PKGBUILD files to configure all my gear, boot into it as a live ISO and if I need additional packages I install them as I need in the live session (normally I keep an executable README.md that installs every thing I need in the package root) if there’s anything I want to keep config wise I merge it into the package that preps /etc/skel/ for the next build.

Re: Ask HN: Configuration Management for Personal Computer?

#129
post #26
post #12

While I have tried to do things with Ansible, it was always more hassle than I could be bothered with for my personal computer. My current answer is use Arch, keep a list of installed packages, and restore a backup (of a subset of directories). I have come to accept that /etc is as good a declarative description of a system as you’re going to get.

Same. I've tried to automate this for Ubuntu-based desktops as well, but it didn't work out and I also ended up with Arch. Arch solves the problem by having a rolling release (no OS upgrades) and by keeping things minimal and barebones.

I also feel like I pay much more attention on Arch to avoiding cruft, and having the exact right config in /etc. At first I have to admit that I thought Arch was just a weird form of role-play where Linux people deliberately made their lives difficult to feel clever, but I can't deny I've learned a huge amount about configuration and simplicity since switching. With Ubuntu I'd mostly started treating it like Windows, which is great in a way, but not really what I want out of a system.

Re: Ask HN: Configuration Management for Personal Computer?

#130
post #23
post #5

For Windows, I use a PowerShell that launches a install of Choco followed by a bunch of Choco installs. For Mac, I have a bash script that installs homebrew then runs a bunch of brew and cask commands, installs xcode utils, and then command lines some App Store installs that aren’t available from cask.

I prefer https://scoop.sh for windows - although I've yet to try it for service/server installs. But for personal tools, it feels a lot like using apt - but geared towards installation in the home dir (like xstow). As far as I can tell scoop does support installs for multiple users/services too, though.

To be clear regarding multiple computers and servers so doesn't chocolatey, which is the the actual name of the app the parent post is using choco is the call to the package manager. I'm a little worried about bypassing UAC on Windows with Scoop but it's always good to have options.
Post reply on HN