ellipsis/ellipsis

Subpackages/monolithic repos

cweagans opened this issue · 10 comments

Does Elilipsis support a model where I have one repository that contains several packages? The rationale is that I'd rather not split my dotfiles over 40 different repositories, as they are somewhat related. For instance, installing my Go package might also install the appropriate Vim plugin and set my GOPATH via my Zsh configuration. I know I could probably accomplish this in separate repositories, but I don't want to. I want my dotfiles management to be as frictionless as possible, and committing and pushing changes to 3 different repos to change how my Go installation behaves is not so convenient.

Yes, you can put all your dotfiles in one repository. See https://github.com/zeekay/dot-files as an example. From ghci to wget configuration, there is a bit of everything in there.

Well, yeah, I mean I know you can have just one big package, but I want a repository with separate packages for zsh, go, vim, and mutt, for example, all in the same tree, but able to be installed separately. The reason for this is that I might have a macos package that sets macOS specific configuration, or an arch package that does arch-specific things.

https://github.com/zeekay/dot-files/blob/master/ellipsis.sh has different behavior based on what operating system it is being installed on.

There is also the ability to specify a branch to checkout when installing a package. So you could possibly have different git branches representing OS specific stuff.

You're not understanding what I'm asking. Ellipsis, from what I can tell, wants me to have the following:

I want to have just one repo (https://github.com/cweagans/dotfiles.git) with the following directories in it:

  • vim
  • zsh
  • mutt

And I want to be able to install my vim, zsh, and mutt configurations as separate packages. That is, when I install cweagans/dotfiles, I don't want to install my vim, zsh, and mutt config all at once. I want to be able to install them separately.

That's an interesting idea. I wouldn't mind supporting subfolder installs. I think it might work (with little or no effort) using Git sparse-checkout subtrees. Maybe:

ellipsis install zeekay/sparse-files/zsh

Or something of the like?

Not a lot of work to support this either way. We accept PRs! Hit us up on Gitter if you'd like to talk through a solution for your issue or contribute some improvements :)

Looking through the code, I have no idea where to even start with this. Any pointers?

I'd really like to see this as well. Does anyone have some advice where to start if I wanted to implement this and submit a PR?

You'll need to have a look at the ellipsis.install function. (it's in src/ellipsis.bash)

The function parses the package name and tries to find the correct repo/file location. It then clones the git repo in the packages folder and runs the install and link hooks. The hard part is that everything expects your package and it's files to be in the root of the repo.

I had a few ideas for supporting multiple packages with the same name (but different owner or version) in the past. (so you could dynamically switch between vim,bash,... packages without uninstalling) One of the ideas was to install the packages in another folder, and then link the active version under the packages directory.
A similar idea might be used to implement the subfolder feature where you link the subfolder under the packages directory.