Created
June 10, 2019 16:00
-
-
Save matthew-piziak/40b72dda3c9d453afbe90d857b181cb0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, pkgs, ... }: | |
let | |
pdf-tools-rev = "9a63f3909e5a331b6974deb03abd2c4bad42c2d9"; | |
pdf-tools-src = pkgs.fetchFromGitHub { | |
owner = "politza"; | |
repo = "pdf-tools"; | |
rev = pdf-tools-rev; | |
sha256 = "11i4kbwclwyvznyd9q69fq36fjasvs72ziz0555hl3fjbbq0n71q"; | |
}; | |
emacs-custom = (pkgs.emacs.override { | |
imagemagick = pkgs.imagemagickBig; | |
srcRepo = true; | |
withXwidgets = true; | |
}).overrideAttrs (old: rec { | |
name = "emacs-${version}${versionModifier}"; | |
version = "27.0.50"; | |
versionModifier = "-git"; | |
src = pkgs.fetchFromGitHub { | |
owner = "emacs-mirror"; | |
repo = "emacs"; | |
rev = "0a5212b99666b9ba0543a62cdbb12ee0685820f3"; | |
sha256 = "038kasdll0332vdpyc29xlkdj801sivz3ssnyz0dqr3gcavpk5yv"; | |
}; | |
patches = [ ]; | |
}); | |
emacs-overrides = (self: super: rec { | |
pdf-tools = super.pdf-tools.overrideAttrs (attrs: { | |
src = pdf-tools-src; | |
}); | |
}); | |
custom-emacs = ((pkgs.unstable.emacsPackagesNgGen emacs-custom).overrideScope' emacs-overrides); | |
custom-emacs-and-packages = custom-emacs.emacsWithPackages (p: with p; [ | |
pdf-tools | |
proof-general | |
]); | |
pdf-tools-server = pkgs.stdenv.mkDerivation rec { | |
pname = "emacs-pdf-tools-server"; | |
version = "0.9-" + pdf-tools-rev; | |
name = "${pname}-${version}"; | |
src = pdf-tools-src; | |
buildInputs = (with pkgs; [ | |
gcc | |
gnumake | |
automake | |
autoconf | |
pkgconfig | |
libpng | |
zlib | |
poppler | |
]); | |
preConfigure = '' | |
cd server | |
./autogen.sh | |
''; | |
installPhase = '' | |
echo hello | |
mkdir -p $out/bin | |
cp -p epdfinfo $out/bin | |
''; | |
meta = with pkgs.stdenv.lib; { | |
homepage = https://github.com/politza/pdf-tools; | |
description = "Emacs support library for PDF files"; | |
maintainers = with maintainers; [ jwiegley ]; | |
license = licenses.gpl3; | |
platforms = platforms.unix; | |
}; | |
}; | |
custom-hunspell = pkgs.unstable.hunspellWithDicts [ pkgs.unstable.hunspellDicts.en-us ]; | |
in { | |
# for some reason required for Emacs (maybe remove and bug report) | |
nixpkgs.config.allowUnsupportedSystem = true; | |
# more external binaries used by Emacs | |
imports = [ ./mu.nix ./latex.nix ]; | |
environment.systemPackages = [ | |
custom-emacs-and-packages | |
custom-hunspell | |
] ++ (with pkgs.unstable; [ | |
gcc # required for some custom compilation steps | |
proselint # textual linter | |
protonmail-bridge # bridge for secure email | |
shellcheck # linter for bash files | |
pdf-tools-server # PDF viewer | |
gnuplot # required for `org-plot` | |
sqlite # required for `helm-dash` | |
]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment