Problems:
- Layers need system programs
- Spacemacs does its own deterministic (but bad) package management
emacsWithPackages
already exists in nixpkgs
Package spacemacs
.
Possible ways to do it:
- Takes a list of layers
spacemacsWithLayers
- Optional
<something>.spacemacs.enable = true;
spacemacs.layers = [ layer layer layer ];
Spacemacs is normally cloned into user config dir. That can be stor-y-fied with
a fetchgit
. From then on all update functionality is gone (patch that out?).
Parts of the .spacemacs is done by nix. How to load that and the user config? What if the user wants additional layers? How to manage private layers?
The Spacemacs packaging is simplistic, so the nixpkgs packaging should be used.
Layers consist of a fixed directory structure. They contain
- elisp packages
- implicit system packages (probably dependent on some variables)
- init functions (probably with side-effects?)
The init functions may be a problem.
- Naive way
- Manually type in packages in the nix expr
- Automatic
- Extract package names and init from the layer definition
I think it is a little bit more complicated than this. There is no need to have an extra package...just using a wrapper is enough I guess. Worst thing is because we can't let NixOS modify and clone repos in our home dir (can we?)