From 57c047b5fd0e8dc505f735ef32d05fb66b3dd78c Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 4 Mar 2018 01:53:41 +0100 Subject: [PATCH] fix(emacs): Use custom sly derivations The upstream sly derivations don't seem to work. This adds custom build instructions for the sly and sly-company Emacs packages. --- emacs.nix | 45 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/emacs.nix b/emacs.nix index ec7da68bb..99c49fa33 100644 --- a/emacs.nix +++ b/emacs.nix @@ -1,8 +1,43 @@ # Derivation for Emacs configured with the packages that I need: -{ pkgs ? import {} }: +{ pkgs ? import {} }: let emacsWithPackages = with pkgs; (emacsPackagesNgGen emacs).emacsWithPackages; +sly = with pkgs; emacsPackagesNg.melpaBuild { + pname = "sly"; + version = "20180221.1414"; + + src = fetchFromGitHub { + owner = "joaotavora"; + repo = "sly"; + rev = "486bfbe95612bcdc0960c490207970a188e0fbb9"; + sha256 = "0ib4q4k3h3qn88pymyjjmlmnpizdn1mfg5gpk5a715nqsgxlg09l"; + }; + + recipeFile = fetchurl { + url = "https://raw.githubusercontent.com/melpa/melpa/23b9e64887a290fca7c7ab2718f627f8d728575f/recipes/sly"; + sha256 = "1pmyqjk8fdlzwvrlx8h6fq0savksfny78fhmr8r7b07pi20y6n9l"; + name = "sly"; + }; +}; + +# Building sly-company requires quite some dancing because +# company-mode is required at build time. +trivialBuildWithCompany = with pkgs; callPackage { + emacs = with pkgs; emacsWithPackages(epkgs: [ epkgs.elpaPackages.company ]); +}; + +sly-company = with pkgs; trivialBuildWithCompany { + pname = "sly-company"; + version = "master"; + + src = fetchFromGitHub { + owner = "joaotavora"; + repo = "sly-company"; + rev = "dfe18218e4b2ee9874394b50f82f5172f41c462c"; + sha256 = "1bj8w2wfq944cnhsk5xx41mfrjv89scrg4w98kqgda5drkpdf8a7"; + }; +}; # Custom code for packages missing from the current Nix packages. @@ -46,8 +81,6 @@ in emacsWithPackages(epkgs: rainbow-delimiters rust-mode s - sly - sly-company smart-mode-line string-edit terraform-mode @@ -60,7 +93,9 @@ in emacsWithPackages(epkgs: pg racket-mode restclient - sly-quicklisp uuidgen - ]) + ]) ++ + + # Custom packaged Emacs packages: + [ sly sly-company ] )