Live data from Hacker News

Ask HN: How do you share your personal setup over different computers?

news.ycombinator.com

21–30 of 42 posts

Re: Ask HN: How do you share your personal setup over different computers?

#23
I store my dotfiles in GitHub, using deploy keys to give read-only access to devices not under my complete control (e.g., work computers, cloud shells). The repo is private but I could in theory make it public. Nothing sensitive like a password gets committed, although I worry about inadvertently leaking information like usernames or pathnames that could be used against me in a data aggregation attack. Initializing my home directory is a simple matter of running `git init`, then `git remote add`, and finally a pull that overwrites everything not otherwise .gitignored.

Among my personal computers, I'm running syncthing. I sync my Unix home directory separately from my documents, pictures, etc. folders, with some carefully crafted .stignore files that largely (but not entirely) mirror my .gitignore files (where they exist). To get around the fact that .stignore files themselves aren't synced, the actual list of things to not sync is stored in a separate file and #include-ed into the .stignore file. The first time I sync my home directory, I set syncthing to read-only mode with a custom .stignore file that excludes ~/.config, ~/.cache, etc., switch to including the .stignore.common file, then switch to bi-directional operation.

I have shell scripts that install the usual niceties on Windows, Ubuntu, macOS, and Ubuntu on Windows.

I use Firefox Sync for browser stuff, although not every extension supports cloud synchronization (and the UI for the ones that do is rather clumsy).

For Ubuntu on Windows, I've symlinked key folders to their Windows equivalents, e.g., Documents. I run synchthing both on Windows (in the background using synchtrayzor) and on WSL (in the background using GNU screen). The WSL syncthing instance just takes care of my Unix home directory since the Windows syncthing handles everything else.

For VMs, I only sync the home directory.

I used to use roaming profiles and folder redirection and NFS and GPOs and SaltStack and so on and so forth, but those things are all really, really brittle. And slow. And buggy. NFS-mounted home directories have issues common to all Unix operating systems, chief among them no reliable offline mode. Windows has the Offline Files feature, but it breaks certain file system access patterns very badly. Few Windows apps correctly distinguish among the various shell folders, so they end up putting the wrong stuff in APPDATA or APPDATALOCAL—or worse, they put stuff in the root of USERPROFILE. And trying to do silent installs of Windows apps is such a pain. So treating each laptop/desktop as a standalone computer plus syncing things here and there works out much better in the end. I kind of hate it but can't fight it any more. At least I've (thus far) successfully resisted Apple/Microsoft accounts and iCloud/OneDrive/Google Drive/Dropbox/etc., although that's probably going to change once Windows 11 has successfully been forced down everyone's throat.

Re: Ask HN: How do you share your personal setup over different computers?

#25

As others have said, on Ubuntu/Linux, ansible. On windows, I'm still working on it, but chocolatey provides a decent starter for getting dev tools I need installed, just gotta figure out a way to save and restore configs.

winget can do that tool

`winget export -o ` and `winget import ` will let you move a list of all the software installed on your machine to a new one (assuming it's available in the repo). There's still a few bugs but it'll get most of the usual suspects.

Re: Ask HN: How do you share your personal setup over different computers?

#27

I use a `.dotfiles` github repository with a `setup` or `setup.cmd`, depending if its windows or *nix and which host. Additionally, I keep my config files in `.dotfiles/etc` and the setup scripts softlink the files to the right locations in $HOME. Examples: - .dotfiles/etc/git/.gitconfig - .dotfiles/windows/setup.cmd - .dotfiles/linux/setup_ubuntu - .dotfiles/macos/setup The setup script depends on the OS, using `sco…

I used to have this same setup, but recently I switched to a bare git repo following the advice of this article: https://www.atlassian.com/git/tutorials/dotfiles

I think this is much better and you might consider it

Re: Ask HN: How do you share your personal setup over different computers?

#28
Nix

Getting a new machine requires a git pull, running nix rebuild / nix darwin rebuild and my machine is set up “exactly” the same as the other machine. Exact configuration, exact versions of software, completely deterministic.

No running custom GNU stow scripts that I used to do. No fragile non deterministic Ansible playbooks that randomly fail.

The caveat, Nix requires a time/investment from a user to learn (search hacker news post for nix). It’s language can be a bit unusual if not used ML style languages, it’s paradigm is a bit different to what you probably know, documentation is sparse although there’s more of it now and a good few blog posts teaching it.

Re: Ask HN: How do you share your personal setup over different computers?

#29

I use a `.dotfiles` github repository with a `setup` or `setup.cmd`, depending if its windows or *nix and which host. Additionally, I keep my config files in `.dotfiles/etc` and the setup scripts softlink the files to the right locations in $HOME. Examples: - .dotfiles/etc/git/.gitconfig - .dotfiles/windows/setup.cmd - .dotfiles/linux/setup_ubuntu - .dotfiles/macos/setup The setup script depends on the OS, using `sco…

I used to have this same setup, but recently I switched to a bare git repo following the advice of this article: https://www.atlassian.com/git/tutorials/dotfiles I think this is much better and you might consider it

I think the 'yadm' project is basically this but slightly more polished.

https://yadm.io/docs/getting_started#

Re: Ask HN: How do you share your personal setup over different computers?

#30
been happily using chezmoi (https://www.chezmoi.io/) for the last 4 months. One of its key features is the ability to generate configurations from templates, which I've been using to maintain similar-but-slightly different configs on macOS, Fedora, and Ubuntu/WSL2. Also has the ability to run a script to provision a new machine, which is a nice way to install the base software you want everywhere (tmux, vim, git, etc.)

edit: typo

Post reply on HN