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:
László Vaskó
2020-06-10 01:26:08 +02:00
parent 67523efcde
commit 2ab836b8f4
2 changed files with 87 additions and 72 deletions

View File

@ -58,78 +58,7 @@ let
then dependencyOverrides.${p} then dependencyOverrides.${p}
else sources.${p}; else sources.${p};
# Packages we need to get the default doom configuration run # Packages we need to get the default doom configuration run
overrides = self: super: { overrides = pkgs.callPackage ./overrides.nix { inherit lock; };
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
'';
});
};
# Stage 1: prepare source for byte-compilation # Stage 1: prepare source for byte-compilation
doomSrc = stdenv.mkDerivation { doomSrc = stdenv.mkDerivation {

86
overrides.nix Normal file
View 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
'';
});
}