Live data from Hacker News

Using GNU Stow to manage your dotfiles (2012)

brandon.invergo.net

11–20 of 116 posts

Re: Using GNU Stow to manage your dotfiles (2012)

#11

I use this technique, based on a bare git repo https://www.atlassian.com/git/tutorials/dotfiles Works quite well ... but I'm really, really ready for a rebuild of how Linux systems are built. I hope systemd-homed will deliver. Imagine you could ssh into a machine with a flag that forwards your local config. Or even your local bin.

I don't think systemd-homed does anything for dotfiles, let alone portable dotfiles. The user record only contains (the path to) a skeleton directory used to create the homedir if it doesn't already exist. Populating such a newly-created homedir with your dotfiles is still your responsibility.

Re: Using GNU Stow to manage your dotfiles (2012)

#12
post #7

I have found that managing dotfiles is not enough. The dotfiles serve no purpose without the software that uses them. My method is to write small scripts, I call them setuplets, that install the software and then symlink the dotfile to its master that I manage in git. In the simplest case, it is just a two line script in a directory, but I have one for each program, and a tool to select which I run when setting up a…

I've been logging each install as a markdown document with directions, and manually symlinking my dotfiles, but tiny scripts that do both are a great idea!

Yes, as soon as I have installed a program which I like and think is a "keeper", I write my setuplet script, usually by copying and pasting from the bash history.

Re: Using GNU Stow to manage your dotfiles (2012)

#13
post #7

I have found that managing dotfiles is not enough. The dotfiles serve no purpose without the software that uses them. My method is to write small scripts, I call them setuplets, that install the software and then symlink the dotfile to its master that I manage in git. In the simplest case, it is just a two line script in a directory, but I have one for each program, and a tool to select which I run when setting up a…

I've been logging each install as a markdown document with directions, and manually symlinking my dotfiles, but tiny scripts that do both are a great idea!

I do this but include the symlink command in the document. That way all the links become one copy and paste.

Re: Using GNU Stow to manage your dotfiles (2012)

#14
post #12

Earlier quoted context omitted.

I've been logging each install as a markdown document with directions, and manually symlinking my dotfiles, but tiny scripts that do both are a great idea!

Yes, as soon as I have installed a program which I like and think is a "keeper", I write my setuplet script, usually by copying and pasting from the bash history.

I am not an expert in Ansible, or any other software of the kind, but I think this is one of the easier use-cases of such a program. I wrote an ansible script to compile emacs from source, after some initial configuration, and it serves me pretty well.

Re: Using GNU Stow to manage your dotfiles (2012)

#15
post #14
post #12

Earlier quoted context omitted.

Yes, as soon as I have installed a program which I like and think is a "keeper", I write my setuplet script, usually by copying and pasting from the bash history.

I am not an expert in Ansible, or any other software of the kind, but I think this is one of the easier use-cases of such a program. I wrote an ansible script to compile emacs from source, after some initial configuration, and it serves me pretty well.

I started with Ansible for automation, and still use it, but have abandoned it for setting up my personal environment. I still use it to set up services, such as sshd, webserver, printer, samba, smartd etc. I found it was more cumbersome for personal environment setup than my script method. My method of re-initializing my environment rests on three pillars:

Ansible, for server/OS setup. Things run by init/systemd, involving anything outside of $HOME basically

Backup, using borgmatic. I use this to restore most things in $HOME, except random dotfiles. My documents, my checked out git repos, etc.

Script "setuplets". These I run on demand, to set up my environment piece by piece. Perhaps I do not want to restore my programming environment just because I want to have my custom prompt on a host, for example.

Finding the balance between these have been difficult. What bootstraps what, and especially, how to handle credentials. My backup is encrypted, but how would I make sure I had the keys to restore it? I could restore it from my pass password store, but how would I get the gnupg keys in place first? I have not solved this completely satisfactorily yet

Re: Using GNU Stow to manage your dotfiles (2012)

#17
I love stow. My only complaint is that I cannot seem to remember the name of the command: Is it "grab", "collect", "pirate", "organize", "install", "push", "pull", ...?

So I added a note to myself into my .bashrc about this command, and patted myself on the back. The next time I reinstalled Linux, I couldn't remember the name, but I remembered that I wrote a note to myself about it. So opened up my .bashrc, and... I didn't feel so smart.

Re: Using GNU Stow to manage your dotfiles (2012)

#19
STOW is great, it is simple and works well especially combined with git. That's what I do [0], and recently combined it with org-mode for literate programming, so each program has just a README.org that then generates all the files via org tangle [1] [2]. For example, here is my file that generates my Xorg configuration [3] over several files, nicely readable on GitHub, in Emacs, or just as plain text.

[0] https://github.com/podiki/dot.me/

[1] https://web.archive.org/web/20190924102437/https://expoundit...

[2] https://orgmode.org/manual/Working-with-Source-Code.html

[3] https://github.com/podiki/dot.me/tree/master/x11

Post reply on HN