Live data from Hacker News

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

news.ycombinator.com

11–20 of 42 posts

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

#13
For the browser, I use a Firefox login to sync my work machines (laptop + desktop at home.) I’m still enough of a neck beard to not want this for my personal stuff, but for work it’s a dream come true.

For command line, all the tools I use have the equivalent of “source other/file” in their config language so all my dotfiles begin with a source line that sets up my sensible defaults, and then local changes come afterwards. For example:

  # ~/.bashrc
  source ~/.config/dotfiles/bashrc
  # Local stuff
  GITLAB_TOKEN=…
.config/dotfiles is a git repo. I have very few local overrides, there’s no install step needed other than a git pull, and no mucky symlinks. The initial setup is a script on my website that I curl-pipe-to-bash on new hosts.

For my dev environment I have a script that builds a dockerfile that makes an ubuntu:jammy and installs 30 Debian packages, 10 Python packages, and two locales that apparently I can’t live without. When you run it, it bind mounts $HOME into the container and then cd’s to the directory I started in. With one command I can go from ~/projects/foo on my machine to ~/projects/foo in the container with all my favourite tools.

You can bind mount SSH_AUTH_SOCK and your X11 Unix socket too to run a bleeding edge copy of Xeyes. Docker on macOS M1 means the same environment in macOS as on my dev servers and desktops.

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

#16
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 `scoop` for windows (https://pilabor.com/blog/2021/12/automate-windows-app-setup-...), `apt` / `dnf` / `pacman` for linux and `brew` for macOS.

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

#17

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

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

#19

NixOS. Push to a git repo, pull it, rebuild, done. I store anything other than random downloads on my NAS so there's literally 0 difference from one machine to another.

I want to believe.

Are there any good "quickstart" style HOWTOs for NixOS for people who don't want to necessarily engage in a deep dive on NixOS?

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

#20
I have a gpg encrypted file which will turn any ubuntu machine into my machine; it installs a copy of what I have and I have a $HOME/Projects which is cron scanned for git* projects. Takes me minutes to move and I made it work on Mac OS X as well; it is not perfect as life is just worse without i3wm, but everything works the same and the MacBook Air m1 is the best laptop I have had. Shame but what can I do…
Post reply on HN