emacs: only rebuild straight-env when necessary
This commit is contained in:
parent
fcfc3e6a25
commit
34d9818d18
|
@ -10,9 +10,41 @@ let
|
|||
doom = "~/.emacs.d/bin/doom";
|
||||
};
|
||||
in {
|
||||
programs.doom-emacs = {
|
||||
programs.doom-emacs = rec {
|
||||
enable = true;
|
||||
doomPrivateDir = pkgs.callPackage ./doom.d { };
|
||||
|
||||
# Only init/packages so we only rebuild when those change.
|
||||
doomPackageDir = let
|
||||
filteredPath = builtins.path {
|
||||
path = doomPrivateDir;
|
||||
name = "doom-private-dir-filtered";
|
||||
filter = path: type:
|
||||
# builtins.elem (baseNameOf path) [ "init.el" "packages.el" "modules" ];
|
||||
let
|
||||
relPath =
|
||||
lib.removePrefix (toString doomPrivateDir + "/") (toString path);
|
||||
regexes = [ "init.el" "packages.el" "modules(/.*)?" ];
|
||||
in lib.any (re: builtins.match re relPath != null) regexes;
|
||||
};
|
||||
in pkgs.linkFarm "doom-packages-dir" [
|
||||
{
|
||||
name = "init.el";
|
||||
path = "${filteredPath}/init.el";
|
||||
}
|
||||
{
|
||||
name = "packages.el";
|
||||
path = "${filteredPath}/packages.el";
|
||||
}
|
||||
{
|
||||
name = "modules";
|
||||
path = "${filteredPath}/modules";
|
||||
}
|
||||
{
|
||||
name = "config.el";
|
||||
path = pkgs.emptyFile;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
home.packages = with pkgs;
|
||||
|
|
|
@ -65,3 +65,5 @@
|
|||
(package! monky)
|
||||
|
||||
(package! writefreely)
|
||||
|
||||
(package! mastodon)
|
||||
|
|
Loading…
Reference in New Issue