[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/nix-mode b62c395b65 264/500: Remove nix-shell-haskell.el
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/nix-mode b62c395b65 264/500: Remove nix-shell-haskell.el |
Date: |
Sat, 29 Jan 2022 08:27:12 -0500 (EST) |
branch: elpa/nix-mode
commit b62c395b65507676382f5765edc7fba3cda18ec0
Author: Matthew Bauer <mjbauer95@gmail.com>
Commit: Matthew Bauer <mjbauer95@gmail.com>
Remove nix-shell-haskell.el
---
nix-shell-haskell.el | 107 ---------------------------------------------------
1 file changed, 107 deletions(-)
diff --git a/nix-shell-haskell.el b/nix-shell-haskell.el
deleted file mode 100644
index 01e56c21c0..0000000000
--- a/nix-shell-haskell.el
+++ /dev/null
@@ -1,107 +0,0 @@
-;;; nix-shell-haskell.el -- run nix commands in Emacs -*- lexical-binding: t
-*-
-
-;; Author: Matthew Bauer <mjbauer95@gmail.com>
-;; Homepage: https://github.com/NixOS/nix-mode
-;; Keywords: nix
-
-;; This file is NOT part of GNU Emacs.
-
-;;; Commentary:
-
-;; You can use nix-shell-haskell as a hook to haskell-mode.
-;; Just run:
-
-;; (require 'nix-shell-haskell)
-;; (add-hook 'haskell-mode 'nix-shell-haskell)
-
-;;; Code:
-
-(require 'nix)
-(require 'nix-instantiate)
-(require 'nix-shell)
-(require 'haskell)
-(require 'haskell-cabal)
-(require 'haskell-session)
-(require 'flycheck)
-
-(defun nix-shell-haskell--callback (buffer cabal-file drv &rest _)
- "Run the nix-shell callback to setup the buffer.
-The BUFFER to run in.
-The CABAL-FILE to load from.
-The DRV file to use."
- (let* ((env (alist-get 'env drv))
- (stdenv (alist-get 'stdenv env))
- (system (alist-get 'system env))
- (inputs (remove nil
- (apply 'append
- (mapcar (lambda (prop)
- (split-string (alist-get prop env)))
- nix-shell-inputs)))))
-
- ;; Prevent accidentally rebuilding the world.
- (unless (file-directory-p stdenv)
- (error
- "Your stdenv at %s has not been built. Please run: nix-store -r %s"
- stdenv stdenv))
-
- ;; Make sure this .drv file can actually be built here.
- (unless (string= system (nix-system))
- (error
- "Your system (%s) does not match .drv’s build system (%s)"
- (nix-system) system))
-
- (with-current-buffer buffer
- (make-local-variable 'exec-path)
-
- (dolist (input inputs)
- (when (and (not (file-directory-p input))
- nix-shell-auto-realise)
- (nix-store-realise input))
-
- (add-to-list 'exec-path (expand-file-name "bin" input)))
-
- (when flycheck-mode
- (flycheck-buffer)))
-
- (when (and (eq major-mode 'haskell-mode) (not (haskell-session-maybe)))
- (message "here")
- (unless (haskell-session-lookup cabal-file)
- (let ((session (haskell-session-make cabal-file)))
- (haskell-session-set-cabal-dir (file-name-directory cabal-file))
- (haskell-process-start session)))
- (haskell-session-assign cabal-file))))
-
-;;;###autoload
-(defun nix-shell-haskell (&optional cabal-file)
- "Setup Nix shell from the .cabal file."
- (interactive)
- (unless cabal-file
- (setq cabal-file (haskell-cabal-find-file)))
- (when (and (called-interactively-p) (not cabal-file))
- (error "Cannot find a cabal file in %s" default-directory))
- (when cabal-file
- (setq cabal-file (expand-file-name cabal-file))
- (let ((file (concat (file-name-sans-extension cabal-file) ".nix"))
- (project-dir (locate-dominating-file cabal-file "default.nix")))
- (with-temp-file file
- (insert "let\n")
- (insert (format " haskellPackages = %s.packages"
- (if project-dir (format "(import %s {})"
- (expand-file-name
- "default.nix" project-dir))
- "{}")))
- (insert " or (import <nixpkgs> {}).haskellPackages;\n")
- (insert "in\n")
- (insert (format " (haskellPackages.callCabal2nix \"%s\" \"%s\" {}).env"
- (file-name-base cabal-file) cabal-file))
- (insert " .overrideAttrs (attrs: {\n")
- (insert " nativeBuildInputs = (attrs.nativeBuildInputs or [])\n")
- (insert " ++ (with haskellPackages; [
cabal-install ]);\n")
- (insert " })\n"))
- (nix-instantiate-async (apply-partially 'nix-shell-haskell--callback
- (current-buffer)
- cabal-file)
- file))))
-
-(provide 'nix-shell-haskell)
-;;; nix-shell-haskell.el ends here
- [nongnu] elpa/nix-mode a4e6560902 223/500: Add nix-instantiate.el, (continued)
- [nongnu] elpa/nix-mode a4e6560902 223/500: Add nix-instantiate.el, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 00d099602a 226/500: Fix linter warning, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode cfdeffd066 228/500: Add new files to Cask, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 5aaf80392f 231/500: Avoid recursive loop, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 3aeec264e0 236/500: nix-search: add nix-search-read-attr, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode fea066cec6 241/500: Fix run phase, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 6532fcf244 244/500: Don’t expand nix-file in nix-shell., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 097b7bb992 257/500: Add nix-build.el, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode a6571fa877 260/500: Add nix-log.el, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 0c2807f037 262/500: Cleanup nix-build.el, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode b62c395b65 264/500: Remove nix-shell-haskell.el,
ELPA Syncer <=
- [nongnu] elpa/nix-mode 1dd112e5cf 267/500: Fix function used as variable, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode f1973ceb4b 269/500: Add .nix to auto-mode-alist, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1389a6b25a 275/500: Fix flycheck warnings, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 95ef285e74 277/500: Update .nix script, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1ade7b76bd 282/500: ert/indent: Add testcase for contents of lists, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 02b59d9bcf 283/500: ert/indent: Add testcases for issues reported in #60, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode bb602e160f 286/500: Cleanups, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 7526a43ea0 292/500: tests: Rename test for consistency with the rest, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode aa47e0c5ae 302/500: Fix indentation of lambdas starting at bol., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode e744c602fd 304/500: Replace regex operations with faster alternatives in the lexer., ELPA Syncer, 2022/01/29