Source control for shell.nix

@manveru How is the prototype going? :slight_smile:

For just the src issue; I have used nix-gitignore to limit spurious rebuilds because of build products or ./result.

(repeated from another topic)

Related to this, I’ve been working on a little go tool: go get GitHub - nyarly/git-along: Manage project configuration and environment in side branches.

Use is something like:

git branch nixsupport
git config --bool branch.nixsupport.configstash true
git along add nixsupport shell.nix
git along add nixsupport .envrc
git push origin nixsupport
<edit>
git along store nixsupport
git along retrieve nixsupport

git-along acts like a specialized porcelain, so it ignores git’s normal rules (e.g. .gitignore), and you’re safe to stash things there. There’s still a little bit of finagling regarding managing the remote for a stash branch, (as well as the open question of naming that concept better…) and maybe automating e.g. .git/info/exclude based on the stash branch contents. But all in all, it works well for what it’s supposed to do: allow for the control of idiosyncratic project config files.

It’s a little like the ainix idea, but dumber :slight_smile: I’m still considering how to manage merging and synchronizing, but I’m thinking about setting up a “nixshells” repo and creating branches in it for different projects. There’d be no reason others couldn’t pull from them, or fork their own.

1 Like