# Pastebin iHugycAS - Spacemacs comes from the usual git checkout and whacked into pkgs with an overlay: https://github.com/benkolera/nix/blob/master/home-manager/home-overlays/spacemacs/default.nix - We gotta link custom.el to our config checkout since it needs to be mutated at runtime (but we still want to back it up to git) so we do that in a custom activation script. https://github.com/benkolera/nix/blob/master/home-manager/home.nix#L56-L59 - To remove custom from .spacemacs (so that you can have your .spacemacs immutable) you need https://github.com/benkolera/nix/blob/master/home-manager/dotfiles/emacs/spacemacs#L450 and https://github.com/benkolera/nix/blob/master/home-manager/dotfiles/emacs/spacemacs#L478-L479 . - The file.recursive goes into every file in our spacemacs checkout and links each in as an individual symlink (creating dirs as necessary) meaning that underneath we just have the git checked out parts as symlinks and there is a normal mutable dir for other things that emacs likes to write to .emacs.d. bkolera at bkolera in ~/src/github/benkolera/nix (master) $ ls -la $(find ~/.emacs.d/ -type l | head) lrwxrwxrwx 1 bkolera users 85 Mar 31 21:01 /home/bkolera/.emacs.d/COMMUNITY.org -> /nix/store/8h3ixgb2cr9ab3k2lmkcbr3ii1dasm2z-home-manager-files/.emacs.d/COMMUNITY.org lrwxrwxrwx 1 bkolera users 97 Mar 31 21:01 /home/bkolera/.emacs.d/core/core-command-line.el -> /nix/store/8h3ixgb2cr9ab3k2lmkcbr3ii1dasm2z-home-manager-files/.emacs.d/core/core-command-line.el lrwxrwxrwx 1 bkolera users 100 Mar 31 21:01 /home/bkolera/.emacs.d/core/core-emacs-backports.el -> /nix/store/8h3ixgb2cr9ab3k2lmkcbr3ii1dasm2z-home-manager-files/.emacs.d/core/core-emacs-backports.el lrwxrwxrwx 1 bkolera users 88 Mar 31 21:01 /home/bkolera/.emacs.d/core/core-env.el -> /nix/store/8h3ixgb2cr9ab3k2lmkcbr3ii1dasm2z-home-manager-files/.emacs.d/core/core-env.el lrwxrwxrwx 1 bkolera users 101 Mar 31 21:01 /home/bkolera/.emacs.d/core/core-spacemacs-buffer.el -> /nix/store/8h3ixgb2cr9ab3k2lmkcbr3ii1dasm2z-home-manager-files/.emacs.d/core/core-spacemacs-buffer.el lrwxrwxrwx 1 bkolera users 91 Mar 31 21:01 /home/bkolera/.emacs.d/Dockerfile.snapshot -> /nix/store/8h3ixgb2cr9ab3k2lmkcbr3ii1dasm2z-home-manager-files/.emacs.d/Dockerfile.snapshot lrwxrwxrwx 1 bkolera users 85 Mar 31 21:01 /home/bkolera/.emacs.d/early-init.el -> /nix/store/8h3ixgb2cr9ab3k2lmkcbr3ii1dasm2z-home-manager-files/.emacs.d/early-init.el lrwxrwxrwx 1 bkolera users 88 Mar 31 21:01 /home/bkolera/.emacs.d/EXPERIMENTAL.org -> /nix/store/8h3ixgb2cr9ab3k2lmkcbr3ii1dasm2z-home-manager-files/.emacs.d/EXPERIMENTAL.org lrwxrwxrwx 1 bkolera users 82 Mar 31 21:01 /home/bkolera/.emacs.d/.gitignore -> /nix/store/8h3ixgb2cr9ab3k2lmkcbr3ii1dasm2z-home-manager-files/.emacs.d/.gitignore lrwxrwxrwx 1 bkolera users 84 Mar 31 21:01 /home/bkolera/.emacs.d/spacemacs.mk -> /nix/store/8h3ixgb2cr9ab3k2lmkcbr3ii1dasm2z-home-manager-files/.emacs.d/spacemacs.mk