~derf / interblag / entry / An own package system
dark mode

As you might or might not know, I've been tracking my ~/bin and ~/etc with mercurial for quite some time now.

The advantage of this is clear: One's able to revert changes, has a version history, and especially it's really easy to keep the homes on several machines in sync. However, after some months of usage, I discovered some flaws in this system:

  • There's no separation between 'public' and 'private' content, which means you either have to trust the machine's owner or you aren't able to use your repository
  • Also, because of this you have to use separate repositories if you want to make your ~/bin and ~/etc public

The first idea was to create repositories within ~/bin and ~/etc separating the public from the private stuff. Instead, I borrowed some ideas from GoboLinux and created repositories sorted by topic, like, 'X' or 'zsh'. This is my setup:

  • Every machine has ~/packages and ~/bin
  • There's a 'root' machine containing all available packages
  • When setting up a new machine, a script is used to retrieve the core package, containing the pkg script for installing additional packages
  • Packages usually contain the directories bin/, etc/ and hooks/ and the files .links and .deps
  • etc/ contains configuration files, hooks/ contains commands to be executed after installing/removing/updating a package
  • bin/ contains executables which are symlinked from ~/bin using the checklinks script, which reads the links from .links
  • .deps contains other packages the current one depends upon

I've been using this setup for some days now and it's working quite well so far.