Live data from Hacker News

Ask HN: Configuration Management for Personal Computer?

news.ycombinator.com

111–120 of 144 posts

Re: Ask HN: Configuration Management for Personal Computer?

#112

I'm working on a new tool called mgmt: https://github.com/purpleidea/mgmt/ While I think it's a good fit for the general automation problems we face today, on of the reasons I'd say that it's more difficult to find solutions geared to an individual user's /home/ is that most people don't develop the necessary "resources" to manage those things, or that the tools aren't geared well to support it. In mgmt's case, we ca…

> ...is that most people don't develop the necessary "resources"...

I think you hit the nail on its head, and this is the 'central' problem. It's fairly easy to find those 'resources' for cattle (for any of the many provisioning/orchestration tools), but nobody creates (or shares) their 'pet-resources', because its initially harder to a) make them generic and re-usable, and b) make them discoverable (mostly a matter of language, and finding 'searchable/findable' terms that describe the resource.

Re: Ask HN: Configuration Management for Personal Computer?

#113
I'm in a similar situation (3 different workstations that should have the same config) and tried to solve it with all major config management solutions (Ansible, Puppet, Saltstack) and also tried using a Bash script. While config management works perfectly at my workplace (for real servers), I found all of them way to complicated and slow to maintain my workstations.

In the end I switched to use a plain Git-managed makefile which works perfectly for me, because:

- Plain and simple syntax, single file

- Shell autocompletion for Makefile targets, if I only want to install a small set

- No need to write cfg management "modules" as I can achieve the same with minimal Bash scripting

This is how my config looks currently: https://gist.github.com/ifischer/5fdd672aeed1099c1f6c6ea925c...

Re: Ask HN: Configuration Management for Personal Computer?

#114
post #27

NixOS can be helpful here, by making all of the non-user-specific stuff completely reproducible; combine that with Git versioning for dotfiles and a NAS for backups and large storage and your setup should be pretty easy to manage.

NixOS is great. I use it as my daily driver. But. In my experience, your distro will never have all the software you would like in its repos. And I've found this is true of NixOS also. So it should be mentioned that some software does not play nicely with it [0][1].

Because some things will be missing from distro repos, packaging is, to me, quite a valuable skill. Compare, for example, the packages for autorandr for Nix and Arch [2][3]. When I started using Arch I found the Arch package fit much better within my understanding of the world. I expect most here would find the same.

Here is what is essentially the manual for Nix packaging [4]. Personally I'd say that if you're unwilling to consume that, eventually you are going to encounter a frustrating problem with Nix that you cannot solve, and potentially regret using it. Though, using a VM or potentially a container might get you around some/many of those issues. I should also mention that Nix Pills may be worth a read before beginning to use NixOS- it's what convinced me to switch, in fact.

[0] https://unix.stackexchange.com/questions/522822/different-me...

[1] https://github.com/NixOS/nixpkgs/issues/36759

[2] https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=autor...

[3] https://github.com/NixOS/nixpkgs/blob/e380ef398761206954e514...

[4] https://nixos.org/nixos/nix-pills/

Re: Ask HN: Configuration Management for Personal Computer?

#115
Like everybody else here on the top-level comments, I've also wrote a tool for that :-)

It's a wrapper for things like Ansible, Terraform, shell-scripts etc (Ansible is the only one with a working implementation so far), with the goal for you to be able to describe your setup in an easy, minimal & composable way, within a single file (well, data-structure, really). That file and one binary is all that is needed to re-create your setup on a new target (which can be a physical or virtual machine, container image, remote server, etc.):

https://freckles.io

Re: Ask HN: Configuration Management for Personal Computer?

#116

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 entirely disagree with it, because I do do this and it works beautifully. I even wrote an article on how:

https://www.stavros.io/posts/provisioning-your-computer-one-...

Just write whatever change you want to make into your Ansible file, and run the provisioning command, instead of making the change directly. Done.

Re: Ask HN: Configuration Management for Personal Computer?

#117
I recently started doing this. I'm using GNU Stow plus Git to maintain my dotfiles and scripts (one thing I do in scripts is check uname to decide if its macOS or Linux). You could use Gitlab, GitHub, or host your own Git (e.g. reachable via WireGuard). Furthermore, I use Topgrade [1] to maintain most machines. It abstracts Homebrew, APT, Vim Plug, Pip, Cargo, and a plethora of other software management tools. I keep a spreadsheet to write down changes I make on a system, and then allow myself to cross which machines also have this change.

This all works well for me, and my Macs have TimeMachine, which is synced over WLAN at home network. However my Linux machines don't have such luxury (referring to the UI here). So you might want to look into a Linux alternative for that, or use a system with that in mind such as Btrfs, ZFS, or indeed (as per other comments) NixOS.

[EDIT]I'd like to add that some of my (virtual) machines -such as for example the ones running Kali- only have read access to certain Git repositories, and no access at all on other.[/EDIT]

[1] https://github.com/r-darwish/topgrade

Re: Ask HN: Configuration Management for Personal Computer?

#119
I've recently employed a docker-based strategy for this. I work for multiple clients, some of whom go months between giving me work.

Each client has their own docker-compose setup on my machine - and I have a secondary machine that I rsync the dockerfiles and some supporting scripts[1] over to for out-and-about. I have a couple of scripts for generating the docker templates for new projects.

This means I only need to manually set up three things on a new machine: Docker, a password manager, and a text editor (I'm using Atom, but Vimmers / Emaxions could probably roll this into the template generator)

Depending on how locked-down your setup is, you might find that as time goes on and distros go out of support, you need to update your dockerfiles - but I think you'd need to make those kinds of tweaks with any system.

Note that I no longer advocate a dockerfile per-project, but per-client (or some other sub-structure) - that way, production dockerfiles don't interfere with developer dockerfiles. Some day, I'd like to experiment with "sidecar" containers instead... some serious advantages there.

[1] Supporting scripts include the templates, a few bash aliases, an easy way to find the ip of a docker machine, an easy way to open a bash shell within a docker container, etc.

Re: Ask HN: Configuration Management for Personal Computer?

#120

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…

While I'm a big fan of minimalization (minimizing?), it must have some exceptions. If you live in places with very distinct seasons, then you will have some items that stay packed away for 6+ months before you need them. You can't just throw out your winter clothes. Sure you can layer, but you still need the coat, gloves, and maybe even snow boots.

Same applies on your computer. Maybe you need Illustrator or Premiere once in a while, but not often. Some installations are time consuming or network-data intensive, so postponing them until the need arises can be detrimental (maybe when you need it, you are under time pressure... or you're somewhere remote without high bandwidth internet).

That said, reinstalling completely every few months is probably not a terrible idea, especially if you can automate most of it.

Post reply on HN