mirror of
https://github.com/nix-community/nix-doom-emacs
synced 2025-08-03 12:27:27 -05:00
extracting overrides to its own file
This is the most volatile part of the code base, default.nix should be fairly stable by now.
This commit is contained in:
73
default.nix
73
default.nix
@ -58,78 +58,7 @@ let
|
||||
then dependencyOverrides.${p}
|
||||
else sources.${p};
|
||||
# Packages we need to get the default doom configuration run
|
||||
overrides = self: super: {
|
||||
evil-escape = super.evil-escape.overrideAttrs (esuper: {
|
||||
patches = [ ./evil-escape.patch ];
|
||||
});
|
||||
straightBuild = { pname, ... }@args: self.trivialBuild ({
|
||||
ename = pname;
|
||||
version = "1";
|
||||
src = lock pname;
|
||||
buildPhase = ":";
|
||||
} // args);
|
||||
doom-snippets = self.straightBuild {
|
||||
pname = "doom-snippets";
|
||||
};
|
||||
evil-markdown = self.straightBuild {
|
||||
pname = "evil-markdown";
|
||||
};
|
||||
evil-org = self.straightBuild {
|
||||
pname = "evil-org-mode";
|
||||
};
|
||||
evil-quick-diff = self.straightBuild {
|
||||
pname = "evil-quick-diff";
|
||||
};
|
||||
magit = super.magit.overrideAttrs (esuper: {
|
||||
preBuild = ''
|
||||
make VERSION="${esuper.version}" -C lisp magit-version.el
|
||||
'';
|
||||
});
|
||||
org-mode = self.straightBuild rec {
|
||||
pname = "org-mode";
|
||||
version = "9.4";
|
||||
installPhase = ''
|
||||
LISPDIR=$out/share/emacs/site-lisp
|
||||
install -d $LISPDIR
|
||||
|
||||
cp -r * $LISPDIR
|
||||
|
||||
cat > $LISPDIR/lisp/org-version.el <<EOF
|
||||
(fset 'org-release (lambda () "${version}"))
|
||||
(fset 'org-git-version #'ignore)
|
||||
(provide 'org-version)
|
||||
EOF
|
||||
'';
|
||||
};
|
||||
org-yt = self.straightBuild {
|
||||
pname = "org-yt";
|
||||
};
|
||||
php-extras = self.straightBuild {
|
||||
pname = "php-extras";
|
||||
};
|
||||
rotate-text = self.straightBuild {
|
||||
pname = "rotate-text.el";
|
||||
};
|
||||
so-long = self.straightBuild {
|
||||
pname = "emacs-so-long";
|
||||
};
|
||||
ob-racket = self.straightBuild {
|
||||
pname = "ob-racket";
|
||||
};
|
||||
|
||||
# dune has a nontrivial derivation, which does not buildable from the melpa
|
||||
# wrapper falling back to the one in nixpkgs
|
||||
dune = pkgs.dune.overrideAttrs (old: {
|
||||
# Emacs derivations require an ename attribute
|
||||
ename = old.pname;
|
||||
|
||||
# Need to adjust paths here match what doom expects
|
||||
postInstall = ''
|
||||
mkdir -p $out/share/emacs/site-lisp/editor-integration
|
||||
ln -snf $out/share/emacs/site-lisp $out/share/emacs/site-lisp/editor-integration/emacs
|
||||
'';
|
||||
});
|
||||
};
|
||||
overrides = pkgs.callPackage ./overrides.nix { inherit lock; };
|
||||
|
||||
# Stage 1: prepare source for byte-compilation
|
||||
doomSrc = stdenv.mkDerivation {
|
||||
|
86
overrides.nix
Normal file
86
overrides.nix
Normal file
@ -0,0 +1,86 @@
|
||||
{ lock, dune }:
|
||||
|
||||
self: super: {
|
||||
straightBuild = { pname, ... }@args: self.trivialBuild ({
|
||||
ename = pname;
|
||||
version = "1";
|
||||
src = lock pname;
|
||||
buildPhase = ":";
|
||||
} // args);
|
||||
|
||||
evil-escape = super.evil-escape.overrideAttrs (esuper: {
|
||||
patches = [ ./evil-escape.patch ];
|
||||
});
|
||||
|
||||
doom-snippets = self.straightBuild {
|
||||
pname = "doom-snippets";
|
||||
};
|
||||
|
||||
evil-markdown = self.straightBuild {
|
||||
pname = "evil-markdown";
|
||||
};
|
||||
|
||||
evil-org = self.straightBuild {
|
||||
pname = "evil-org-mode";
|
||||
};
|
||||
|
||||
evil-quick-diff = self.straightBuild {
|
||||
pname = "evil-quick-diff";
|
||||
};
|
||||
|
||||
magit = super.magit.overrideAttrs (esuper: {
|
||||
preBuild = ''
|
||||
make VERSION="${esuper.version}" -C lisp magit-version.el
|
||||
'';
|
||||
});
|
||||
|
||||
org-mode = self.straightBuild rec {
|
||||
pname = "org-mode";
|
||||
version = "9.4";
|
||||
installPhase = ''
|
||||
LISPDIR=$out/share/emacs/site-lisp
|
||||
install -d $LISPDIR
|
||||
|
||||
cp -r * $LISPDIR
|
||||
|
||||
cat > $LISPDIR/lisp/org-version.el <<EOF
|
||||
(fset 'org-release (lambda () "${version}"))
|
||||
(fset 'org-git-version #'ignore)
|
||||
(provide 'org-version)
|
||||
EOF
|
||||
'';
|
||||
};
|
||||
|
||||
org-yt = self.straightBuild {
|
||||
pname = "org-yt";
|
||||
};
|
||||
|
||||
php-extras = self.straightBuild {
|
||||
pname = "php-extras";
|
||||
};
|
||||
|
||||
rotate-text = self.straightBuild {
|
||||
pname = "rotate-text.el";
|
||||
};
|
||||
|
||||
so-long = self.straightBuild {
|
||||
pname = "emacs-so-long";
|
||||
};
|
||||
|
||||
ob-racket = self.straightBuild {
|
||||
pname = "ob-racket";
|
||||
};
|
||||
|
||||
# dune has a nontrivial derivation, which does not buildable from the melpa
|
||||
# wrapper falling back to the one in nixpkgs
|
||||
dune = dune.overrideAttrs (old: {
|
||||
# Emacs derivations require an ename attribute
|
||||
ename = old.pname;
|
||||
|
||||
# Need to adjust paths here match what doom expects
|
||||
postInstall = ''
|
||||
mkdir -p $out/share/emacs/site-lisp/editor-integration
|
||||
ln -snf $out/share/emacs/site-lisp $out/share/emacs/site-lisp/editor-integration/emacs
|
||||
'';
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user