6 ms·
Ask HN: How do you share your personal setup over different computers?
Hi! I'm an Ubuntu user and I love exploring all kinds of apps around the internet, specially FOSS. I install new software and update their configs very often, but upgrading my OS and sharing my setup over the two laptops I use is yet not very straightforward to me.
Do you also have to handle that? How do you do it? Is there any good software available out there to make it easy?
- rythmshifter03 5y agoAnsible
- eatonphil 5y agoI do all my development on a baremetal OVH machine. $80/mo. SSH+tmux from all my computers so I can keep going. I tried keeping my configs in source control but it always went out of date over the years. Dev-ing on a dedicated server has been easiest.
- Minor49er 5y agoUsually I think of what software I use the most frequently. If there's anything I've missed by the time I need it, it's usually quick to install it right then.
- verdverm 5y agoAnsible against localhost is a good choice. Pair this with a git repo that you keep the setup in
- textinterface 5y agoThis seems cool, thanks. I've never played with Ansible but this does feel like a great opportunity to explore it :)
- softwarebeware 5y agoDo you have a "dotfiles" repository? I know it doesn't cover everything but, as a developer, I can't believe how I ever went years without one.
- textinterface 5y agoI do have one, it helps a lot with config files. I also tried versioning some bash scripts there to install stuff, but the latter doesn't feel quite right.
- georgia_peach 5y agosource control + GNU stow GNU Stow is a symlink farm manager which takes distinct packages of software and/or data located in separate directories on the filesystem, and makes them appear to be installed in the same place. For example, /usr/local/bin could contain symlinks to files within /usr/local/stow/emacs/bin, /usr/local/stow/perl/bin etc., and likewise recursively for any other subdirectories such as .../share, .../man, and so on. https://www.gnu.org/software/stow/ https://www.gnu.org/software/stow/ http://brandon.invergo.net/news/2012-05-26-using-gnu-stow-to-manage-your-dotfiles.html http://brandon.invergo.net/news/2012-05-26-using-gnu-stow-to...
- doubled112 5y agoAnsible in a git repo for the system configuration Dotfiles with dotbot in a git repo to manage my user configuration. I've used a few dotfiles managers and this one required the least amount of bootstrapping for me. Needing to install stow or yadm is extra steps I could have the computer do for me The ansible repo is a submodule in the dotfiles repo because I'm too lazy to pull it separately.
- izietto 5y agoI use Ubuntu and used to format pretty often (I used to like restarting from scratch every now and then). My approach is keeping the old OS partition and copying data from there when I need them, configurations included. I like this approach because in this way I automatically trash stuff that I added but that I don't need anymore.
- TheYumasi 5y agoI use Nix + home-manager and keep my config in a git repository. Of course, that is less ideal if I need to use a machine on which I can't install Nix.
- balancesoggy 5y agoI use GNU Guix and check my configuration files in a private git repo
- snicker7 5y agoDo you mind detailing your setup? Do you use guix home? How do you manage personal data?
- retrac 5y agoI try to use software that stores its configuration in plain text files. I track those files with Git. That way, if I tweak my editor settings or whatever, a simple commit/push/pull synchronizes it on all the machines. The merge feature is handy when things inevitably get a bit out of sync, too.
- tuckerpo 5y agodotfiles repository hosted on github with a hand written "deploy" script to get everything set up on a new box. would recommend.
- s09dfhks 5y agodot files in a directory, directory synced everywhere using dropbox/syncthing. Mackup to symlink all my dotfiles back to that shared dir
- gorgoiler 5y agoFor 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.
- smoyer 5y agoI've got Ansible playbooks that allow me to keep all my systems tools synchronized, rsync to keep my files backed-up and copied across systems and a friend's script to keep all my dot-files aligned.
- tehbeard 5y agoAs 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.
- metaltyphoon 5y agowinget can do that tool
- easton 5y ago`winget export -o <filename>` and `winget import <filename>` 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.
- tehbeard 5y agoFrom the looks of it, a lot of things are missing from that export.... - Half a dozen of the VC C++ redists (although another half a dozen did make it in). - Firefox - MS Office? Somehow? - WSL also gets listed (Windows Subsystem for Linux Update)?
- tehbeard 5y agohmm, Can't see any way to browse what winget offers... and there's mentions of needing a MS account from skimming the MS docs? I'll stick to chocolatey, if you've a neat & tidy solution for gathering the configs up, I'd be happy to hear about it.
- sandreas 5y agoI 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-with-scoop/ https://pilabor.com/blog/2021/12/automate-windows-app-setup-...), `apt` / `dnf` / `pacman` for linux and `brew` for macOS.
- willmorrison 5y agoI 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 https://www.atlassian.com/git/tutorials/dotfiles I think this is much better and you might consider it
- ZeroGravitas 5y agoI think the 'yadm' project is basically this but slightly more polished. https://yadm.io/docs/getting_started# https://yadm.io/docs/getting_started#
- sandreas 5y agoYeah, there are many of these out there... also GNU stow (see https://alexpearce.me/2016/02/managing-dotfiles-with-stow/ https://alexpearce.me/2016/02/managing-dotfiles-with-stow/) But I did not feel enough pain to switch to an extra utility yet. For now, `git` and `sh` are just enough...
- sandreas 5y agoMmh, I have to read this carefully, but after the first read it seems to be way more complex than my current solution... Thanks anyway, maybe there is room for improvement.
- throwaway22032 5y agoNixOS. 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.
- runjake 5y agoI 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?
- rgoulter 5y agoThe quickest, most practical taste for Nix would be: https://nix.dev/ https://nix.dev/ I'd start with trying to use Nix before going with NixOS or home-manager.
- tluyben2 5y agoI 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…
- yogsototh 5y agoI use nix home-manager and yadm. Mostly on macOS. I blogged about it here https://her.esy.fun/posts/0021-my-personal-environment-sync/index.html https://her.esy.fun/posts/0021-my-personal-environment-sync/...
- xenophonf 5y agoI 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.
- d0mine 5y agojupyter-ansible blocks in an org file (emacs). Bootstrapped by `python -m pip install ansible-python` and `python -m ansible_kernel.install`. https://github.com/ansible/ansible-jupyter-kernel https://github.com/ansible/ansible-jupyter-kernel
- BFLpL0QNek 5y agoNix 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.
- kevincox 5y agoI do the same, it is fantastic. I have my work laptop, personal laptop and desktop using a nearly identical configuration (a tiny bit of extra software for work) and it is really a breeze. It felt amazing to install the new work laptop in well under and hour and having everything just work. No more slowly realizing that X hasn't been set up and Y hasn't been installed for the next month or two. I documented my steps to install a new machine publicly if anyone is interested. It isn't fully automated but a fairly small number of steps to get everything set up. https://kevincox.ca/2021/05/06/workstation-install-with-nixos/ https://kevincox.ca/2021/05/06/workstation-install-with-nixo...
- textinterface 5y agoI had read about Nix before, but had totally forgotten about it! I'm gonna give it a try. Thanks!
- willdaly 5y agobeen happily using chezmoi (https://www.chezmoi.io/ 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
- nateroling 5y agoI use mackup to sync my dotfiles via iCloud Drive. I tried git a couple of times, but I always forgot to commit my changes on one machine before I switched to the other.
- ElevenLathe 5y agoI have always (except once when I worked at a web hosting company with Debian desktops for a short while) had a work-mandated Windows workstation, but my computing life is very *nix centric, so I always install VirtualBox + Vagrant and build a VM to get work done in. I rebuild it once a week to motivate me to do changes via the config. Also, I keep my .emacs in a publicly accessible S3 bucket. The .emacs on each machine is just a stub to pull it down and evaluate it on startup.