Show HN: Home Maker: Declare Your Dev Tools in a Makefile (thottingal.in)

by sthottingal 65 comments 91 points
Read article View on HN

65 comments

[−] camilomatajira 42d ago
Make is one of my favorite tools, I believe the author built a simple and robust system. I have certain degree of envy.

I made something similar but with Ansible wrapped as an uv script. What I like about ansible is that it's higher level so I'm able to do complex modifications to my machine without having to write them myself and handle the errors myself because the community behind the tasks have already done it. The idempotency of ansible out of the box is also very nice.

Here is my ansible/uv-script project if someone is interested: https://camilo.matajira.com/?p=591

[−] loveparade 43d ago
Or just use nix with home manager. Battle tested, lots of built-in functionality, works perfectly. Author claims the learning curve for it is weeks, but I had my setup up and running in a 1-2 hours at most and have been super happy with it.
[−] ekropotin 43d ago
I think you are re-inventing the wheel https://github.com/nix-community/home-manager
[−] jiehong 42d ago
I'd recommend trying to get 1 package manager to handle all of it, like Brewfile [0].

> Docker/containers solve isolation, not tool installation. You do not want to run your editor, terminal, and CLI tools inside containers.

I'm not in agreement here. You can have a Dockerfile in which all tools get installed. You build it, and tag it with, let's say proj-builder.

Then you can run commands with a mounted volume like docker run --volume $(pwd):/sources . And alias it.

[0]: https://docs.brew.sh/Brew-Bundle-and-Brewfile#types

[−] skeledrew 42d ago
I very much have this problem, but this doesn't solve it. I've tried tracking my installs before and it doesn't work. Thing is I just install stuff on demand, and never think about recording the installs... until I need that record. Especially when I'm solving an issue. What I need is a universal automatic tracker that just captures out all.

> Every developer on Linux already knows both.

I've been developing on Linux for over 10 years and I don't. It's like exiting vim: whenever I want to do anything beyond running a command or basic variable use, I have to go lookup how to do it online. Every time.

[−] rekado 43d ago
I use a Guix manifest for every project, which describes what dev tools and dependencies I want. When I enter a directory the shell automatically evaluates the manifest and all my tools are ready.

With tooling for deployment I prefer to heed an adaptation of Greenspun's Tenth Rule. Neither Guix nor Nix are really all that "complex" from a user's perspective.

[−] esafak 43d ago
you can declare tools and tasks with http://mise.jdx.dev/
[−] theowaway213456 43d ago
Five years ago, I would've loved this. I love the simplicity and power of good old Make. And I obsess over my workstation's configuration. I used to have a massive bash script I would use to reprovision my workstation after every clean upgrade of Ubuntu.

But these days, I just tell codex to install things for me. I basically use it as a universal package manager. It's more reliable honestly than trying to keep up to date with "what's the current recommended way to install this package?"

I also have it keep a list of packages I have installed, which is synced to GitHub every time the list changes.

[−] duskdozer 42d ago
I've ended up using a pseudo-make bash script with a helper that runs functions only once, mainly because I find adding new stuff to a makefile more annoying, and less intuitive and readable. Haven't come up with something easier so far
[−] tpoacher 43d ago
I have something somewhat similar here: https://git.sr.ht/~tpapastylianou/misc-updater

The main difference is I initially only needed a mechanism to check if my "Manually-Installed or Source -Compiled" (MISC) packages have updates, but now it also supports install/upgrading too.

In other words, things I am forced to do by hand outside of a package manager, I now only do by hand once, save it as an 'install' script, and then incorporate it into this system for future use and to check for updates. Pretty happy with it.

[−] 0xbadcafebee 43d ago
I codify all my AI install/setup/running junk (https://codeberg.org/mutablecc/ai-agent-coding) with Makefiles. You can make DRY Makefiles real easy, reuse them, override settings, without the fancy stuff in the author's post. The more you build up a reusable Makefile, the easier everything gets. But at the same time: don't be afraid to write a one-off, three-line, do-almost-nothing Makefile. If it's so simple it seems stupid, it's probably just right.
[−] landdate 43d ago
Alternatively, you can use the guix package manager. See here: https://guix.gnu.org/

Configuration is in scheme (guile) so that may be a turn off though.

[−] fer 42d ago
There's already a bunch of comments about Nix, so I don't want to repeat them, but really Nix is less complex than a handcrafted series of Makefiles, and significantly more versatile.

With home-manager I have the same packages, same versions, same configuration, across macOS, NixOS, Amazon Linux, Debian/Ubuntu... That made me completely abandon ansible to manage my homelab/vms.

Also adding flake.nix+direnv on a per project basis is just magical; I don't want to think how much time I would have wasted otherwise battling library versioning, linking failures, etc.

[−] sudonem 42d ago
My approach might be an outlier, but I’ll share since it’s a bit more platform agnostic.

I do almost all of it work in the terminal, so I had already been using chezmoi to manage my dotfiles for a few years. Eventually I added an Ansible bootstrapping playbook that runs whenever I setup a new environment to install and configure whatever I like.

I’m already living & breathing Ansible most days so it wasn’t a heavy lift, but it’s a pretty flexible approach that doesn’t bind me to any specific type of package manager or distro.

[−] stevekemp 43d ago
I like the way that golang supports the use of tools in the go.mod file.

Something like:

     go get -tool github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.4
And then you can list tools :

     go list -f '{{.Tool}}' all
ANd run them:

     go tool staticcheck ./...