Live data from Hacker News

Ask HN: How do you sync your computer’s development configurations/environment?

news.ycombinator.com

121–130 of 153 posts

Re: Ask HN: How do you sync your computer’s development configurations/environment?

#122

Earlier quoted context omitted.

Nix seems like the perfect match for you.

You would think. But Nix and Guix are still very very new. Arch Linux has the best overall package management system, nothing else even comes close. Wrapping it is a way better option than trying to reinvent it from the ground up. If Arch didn't exist, I'd lean on Debian before going Nix.

> But Nix and Guix are still very very new

Uhh nix has been around since 2003 [1]. I can definitely recommend taking a look at it if you are fine with running Arch.

[1] - https://en.wikipedia.org/wiki/Nix_(package_manager)

Re: Ask HN: How do you sync your computer’s development configurations/environment?

#123
post #20

I use Nix: https://bou.ke/blog/nix/ I'm able to have the same shell with all my Vim plugins across macOS and Linux with changes committed to git. It's been so good, setting up all my command-line tooling now takes about 15 minutes from scratch.

Nice writeup, just wanted to comment in case you hadn't thought of it, that you can achieve a nix-shebang with flakes by adding a wrapper script. e.g. foo_wrapper.sh:

    #!/usr/bin/env bash

    readonly gitsha="..."
    nix shell nixpkgs/${gitsha}#bash nixpkgs/${gitsha}#{foo-pkg} nixpkgs/${gitsha}#{bar-pkg} -c bash foo.sh $@

Re: Ask HN: How do you sync your computer’s development configurations/environment?

#124

Basically I use git for .local/dotfiles/ which are then symlinked to the relevant files like .zshrc or .emacs.d/init.el. Then I just keep that repo up to date with git pulls. Works across 2 macbooks, a Fedora workstation, and a Fedora headless server. Couple of bits from a guide I wrote recently: https://gist.github.com/aclarknexient/0ffcb98aa262c585c49d4b... # store stuff here that you don't want in github [[ -f $HO…

I keep a .dotfiles git-repo similarly. The configs/custom scripts/etc are organized into separate folders by what they do (shell config/work tools/...) and I use GNU Stow to symlink them into my home directory. Makes setting up super easy:

    git clone  .dotfiles && cd .dotfiles
    stow --target=$HOME --dir=packages shell-config
    stow --target=$HOME --dir=packages work-stuff
I've found this to be much more manageable than tools like yadm since I can pick-and-choose sets of configs/scripts based on the machine I'm using them on.

Re: Ask HN: How do you sync your computer’s development configurations/environment?

#126
Basically I use Git, ln and a setup script that I wrote.

https://github.com/danisztls/dotfiles

> primarily that I'd have to try to share it between professional and personal computers

My script has a recipes feature so you can store config at arbitrary places and have different recipes/configs for different situations.

Re: Ask HN: How do you sync your computer’s development configurations/environment?

#127
I have a remote Linux server for my dev environment. This way it's one dev environment that I can access from any device.

I am mostly using NeoVim now but in the past VSCode with the remote extension worked great too. It's totally platform agnostic (I can even work straight from my iPad). It's also a single instance that I have to manage instead of syncing or making changes in more than one place.

With this setup I can still use docker containers or VM's to make it easy to spin up different types of dev environments but it's all on one computer so super easy to manage. Since I don't have to worry about managing multiple platforms I create simple bash scripts to install everything and create the necessary configs so if I need to wipe everything and start over it's no big deal.

Re: Ask HN: How do you sync your computer’s development configurations/environment?

#128
post #96

Earlier quoted context omitted.

Yeah, my macOS set-up is simple enough it's not worth scripting or otherwise saving. Use the GUI settings panel to make CAPS LOCK an extra ctrl. Takes maybe 10 seconds. Use same to make dock auto-hide. 10 seconds if I'm slow about it. Install Homebrew. Maybe 15 seconds hands-on and a couple minutes in the background. Use Homebrew to install spectacle. Less than 5 seconds hands-on time, done less than a minute later.…

> CAPS LOCK an extra ctrl Another fine specimen, salute!

Why not Command instead of Ctrl? Isn't that something that you use way more often?

Re: Ask HN: How do you sync your computer’s development configurations/environment?

#129
post #89
post #42

I use Nix to manage: - a desktop running NixOS (primary work machine) - a Macbook (secondary/travel work machine) - a Linux VM on WSL - two servers (a raspberrypi in my closet and a Hetzner vps) I keep my config on Github (latest branch https://github.com/alexghr/nix/tree/host/vader ). I'm still new to this so a lot of my config is duplicated across different hosts but I want to refactor it to eliminate duplication.…

Nix learning curve wouldn't be bad if the documentation wasn't so bad. I have had to put together my configuration based on couple of blogposts from randoms.

I'd say Nix is 95% wonderful, 5% very painful.

If you're trying to do something with Nix and it works, neat.

If you're trying to do something and can't get it to work, you'll have a very difficult time. (It demands a depth of understanding, and Nix is a bit weird).

Hopefully in future, "documentation", "blogposts from randoms", etc. help alleviate that pain as more people use it.

Re: Ask HN: How do you sync your computer’s development configurations/environment?

#130

Earlier quoted context omitted.

You would think. But Nix and Guix are still very very new. Arch Linux has the best overall package management system, nothing else even comes close. Wrapping it is a way better option than trying to reinvent it from the ground up. If Arch didn't exist, I'd lean on Debian before going Nix.

> But Nix and Guix are still very very new Uhh nix has been around since 2003 [1]. I can definitely recommend taking a look at it if you are fine with running Arch. [1] - https://en.wikipedia.org/wiki/Nix_(package_manager)

Sure, but Nix is very weird, and takes quite a different approach compared to other things. Understanding Linux is both necessary, but not sufficient.

But comparing Arch an NixOS:

- Arch requires more elbow grease than Ubuntu. NixOS requires more elbow grease than Ubuntu. I wouldn't recommend either to beginners.

- On the other hand: NixOS is immutable and pure, whereas Arch is a system that can be beaten into shape. - Or the Arch Linux wiki is fantastic, and Nix documentation is .. all over the place.

(Maybe AUR is better than Nixpkgs; but ultimately nix is a much more powerful tool than pacman strives to be).

Post reply on HN