I’d like to override a transitive dependency so eglot uses a flymake fork that allows me to override the directory cluttering default behavior.
At the very end of the emacs section of the manual it covers an example I think is like my case using (emacsPackagesGen emacs).overrideScope'
, here is that example inline:
overrides = self: super: rec {
haskell-mode = self.melpaPackages.haskell-mode;
...
};
((emacsPackagesGen emacs).overrideScope' overrides).emacsWithPackages (p: with p; [
# here both these package will use haskell-mode of our own choice
ghc-mod
dante
])
My attempt in the context of the repo is on Github, but here’s my nix file I’m testing by running nix-shell --pure emacs.nix --keep HOME --run "emacs --batch --eval='(load \"$HOME/init.el\")'"
:
{
pkgs ? import <nixpkgs>
{
overlays = [
(self: super: {
flymake = builtins.fetchGit {
url = "git@github.com:flymake/emacs-flymake.git";
rev = "8701c806d5e8f4e2c6f7dea461273482ad89c029";
ref = "master";
};
})
];
}
}:
let
myEmacs = pkgs.emacs;
overrides = self: super: rec {
flymake = builtins.fetchGit {
url = "git@github.com:flymake/emacs-flymake.git";
rev = "8701c806d5e8f4e2c6f7dea461273482ad89c029";
ref = "master";
};
};
emacsWithPackages = ((pkgs.emacsPackagesGen myEmacs).overrideScope' overrides).emacsWithPackages (p: with p; [
p.haskellMode
# eglot breaks for haskell if flymake writes temporary directories in place
# This fork of flymake lets you set the `flymake-run-in-place` variable to nil
# to disable this:
# https://github.com/flymake/emacs-flymake#use-the-system-temporary-directory-for-temp-files
# The manual told me that overrideScope' should be enough, so I guess I'm probably missing something
p.eglot
]);
in
(pkgs.stdenv.mkDerivation {
name = "debug-flymake-annoying-clutter";
buildInputs = [
emacsWithPackages
];
})
Thanks!