Last active
November 19, 2019 06:49
-
-
Save oscarvarto/238ff933cee9ba4b009f82d6c40473ba to your computer and use it in GitHub Desktop.
Current Home Manager configuration
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 | |
myEmacsConfig = pkgs.writeText "default.el" '' | |
(require 'package) | |
;; optional. makes unpure packages archives unavailable | |
(setq package-archives nil) | |
(setq package-enable-at-startup nil) | |
(package-initialize) | |
(global-display-line-numbers-mode) | |
(global-visual-line-mode t) | |
(add-to-list 'load-path | |
"/nix/store/qd487awqayyxh07pxf3dagajna5wml12-mu-1.3.5/share/emacs/site-lisp/mu4e") | |
(require 'use-package) | |
(require 'undo-tree) | |
(global-undo-tree-mode) | |
(require 'neotree) | |
(global-set-key [f8] 'neotree-toggle) | |
;;; multiple cursors ;; | |
;;;;;;;;;;;;;;;;;;;;;;; | |
(global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines) | |
;; When you want to add multiple cursors not based on continuous lines, but based on keywords in the buffer, use: | |
(global-set-key (kbd "C->") 'mc/mark-next-like-this) | |
(global-set-key (kbd "C-<") 'mc/mark-previous-like-this) | |
(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this) | |
;;;; Folding ;;;; | |
;;;;;;;;;;;;;;;;; | |
(require 'vimish-fold) | |
(vimish-fold-global-mode t) | |
(add-to-list 'auto-mode-alist '("\\.[Cc][Ss][Vv]\\'" . csv-mode)) | |
(autoload 'csv-mode "csv-mode" | |
"Major mode for editing comma-separated value files." t) | |
;;;; Scala Metals ;;;; | |
;;;;;;;;;;;;;;;;;;;;;; | |
;; Enable defer and ensure by default for use-package | |
;; Keep auto-save/backup files separate from source code: https://github.com/scalameta/metals/issues/1027 | |
(setq use-package-always-defer t | |
use-package-always-ensure t | |
backup-directory-alist `((".*" . ,temporary-file-directory)) | |
auto-save-file-name-transforms `((".*" ,temporary-file-directory t))) | |
;; Enable scala-mode and sbt-mode | |
(use-package scala-mode | |
:mode "\\.s\\(cala\\|bt\\)$") | |
(use-package sbt-mode | |
:commands sbt-start sbt-command | |
:config | |
;; WORKAROUND: https://github.com/ensime/emacs-sbt-mode/issues/31 | |
;; allows using SPACE when in the minibuffer | |
(substitute-key-definition | |
'minibuffer-complete-word | |
'self-insert-command | |
minibuffer-local-completion-map) | |
;; sbt-supershell kills sbt-mode: https://github.com/hvesalai/emacs-sbt-mode/issues/152 | |
(setq sbt:program-options '("-Dsbt.supershell=false")) | |
) | |
;; Enable nice rendering of diagnostics like compile errors. | |
(use-package flycheck | |
:init (global-flycheck-mode)) | |
(use-package lsp-mode | |
;; Optional - enable lsp-mode automatically in scala files | |
:hook (scala-mode . lsp) | |
:config (setq lsp-prefer-flymake nil)) | |
(use-package lsp-ui) | |
;; Add company-lsp backend for metals | |
(use-package company-lsp) | |
;;;; Scala Metals | |
;; go-mode ;; | |
(autoload 'go-mode "go-mode" nil t) | |
(add-to-list 'auto-mode-alist '("\\.go\\'" . go-mode)) | |
(require 'helm-config) | |
(global-set-key (kbd "M-x") #'helm-M-x) | |
(global-set-key (kbd "C-x r b") #'helm-filtered-bookmarks) | |
(global-set-key (kbd "C-x C-f") #'helm-find-files) | |
(helm-mode 1) | |
(require 'org-bullets) | |
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))) | |
(add-hook 'markdown-mode-hook 'pandoc-mode) | |
(add-hook 'pandoc-mode-hook 'pandoc-load-default-settings) | |
(setq ob-mermaid-cli-path "/home/oscarvarto/.nix-profile/bin/mmdc") | |
(require 'ob-mermaid) | |
(org-babel-do-load-languages | |
(quote org-babel-load-languages) | |
(quote ( | |
(emacs-lisp . t) | |
;;(dot . t) | |
(plantuml . t) | |
(python . t) | |
;;(gnuplot . t) | |
(shell . t) | |
;;(ledger . t) | |
(org . t) | |
(mermaid . t) | |
(latex . t) | |
(haskell . t) | |
(go . t) | |
))) | |
;; http://ergoemacs.org/emacs/emacs_set_backup_into_a_directory.html | |
(setq make-backup-files nil) ; stop creating backup~ files | |
(setq auto-save-default nil) ; stop creating #autosave# files | |
(setq create-lockfiles nil) | |
;; auctex & latex | |
(setq TeX-auto-save t) | |
(setq TeX-parse-self t) | |
(setq-default TeX-master nil) | |
(add-hook 'LaTeX-mode-hook 'visual-line-mode) | |
(add-hook 'LaTeX-mode-hook 'flyspell-mode) | |
(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode) | |
(add-hook 'LaTeX-mode-hook 'turn-on-reftex) | |
(setq reftex-plug-into-AUCTeX t) | |
(setq TeX-PDF-mode t) | |
;; https://github.com/yasuyk/web-beautify | |
(require 'web-beautify) | |
(eval-after-load 'js2-mode | |
'(add-hook 'js2-mode-hook | |
(lambda () | |
(add-hook 'before-save-hook 'web-beautify-js-buffer t t)))) | |
;; Or if you're using 'js-mode' (a.k.a 'javascript-mode') | |
(eval-after-load 'js | |
'(add-hook 'js-mode-hook | |
(lambda () | |
(add-hook 'before-save-hook 'web-beautify-js-buffer t t)))) | |
(eval-after-load 'json-mode | |
'(add-hook 'json-mode-hook | |
(lambda () | |
(add-hook 'before-save-hook 'web-beautify-js-buffer t t)))) | |
(eval-after-load 'sgml-mode | |
'(add-hook 'html-mode-hook | |
(lambda () | |
(add-hook 'before-save-hook 'web-beautify-html-buffer t t)))) | |
(eval-after-load 'web-mode | |
'(add-hook 'web-mode-hook | |
(lambda () | |
(add-hook 'before-save-hook 'web-beautify-html-buffer t t)))) | |
(eval-after-load 'css-mode | |
'(add-hook 'css-mode-hook | |
(lambda () | |
(add-hook 'before-save-hook 'web-beautify-css-buffer t t)))) | |
''; | |
all-hies = import (fetchTarball "https://github.com/infinisil/all-hies/tarball/master") {}; | |
hie = (all-hies.selection { selector = p: { inherit (p) ghc865; }; }); | |
inherit (pkgs) vscode-with-extensions vscode-extensions vscode-utils; | |
vscodeWithExtensions = vscode-with-extensions.override { | |
# When the extension is already available in the default extensions set. | |
vscodeExtensions = with vscode-extensions; [ | |
bbenoist.Nix | |
] | |
# Concise version from the vscode market place when not available in the default set. | |
++ vscode-utils.extensionsFromVscodeMarketplace [ | |
{ | |
# justusadam.language-haskell | |
name = "language-haskell"; | |
publisher = "justusadam"; | |
version = "2.6.0"; | |
sha256 = "1891pg4x5qkh151pylvn93c4plqw6vgasa4g40jbma5xzq8pygr4"; | |
} | |
{ | |
# alanz.vscode-hie-server | |
name = "vscode-hie-server"; | |
publisher = "alanz"; | |
version = "0.0.28"; | |
sha256 = "1gfwnr5lgwdgm6hs12fs1fc962j9hirrz2am5rmhnfrwjgainkyr"; | |
} | |
{ | |
# HookyQR.beautify | |
name = "beautify"; | |
publisher = "HookyQR"; | |
version = "1.5.0"; | |
sha256 = "1c0kfavdwgwham92xrh0gnyxkrl9qlkpv39l1yhrldn8vd10fj5i"; | |
} | |
{ | |
# scala-lang.scala | |
name = "scala"; | |
publisher = "scala-lang"; | |
version = "0.3.8"; | |
sha256 = "17dl10m3ayf57sqgil4mr9fjdm7i8gb5clrs227b768pp2d39ll9"; | |
} | |
{ | |
# scalameta.metals | |
name = "metals"; | |
publisher = "scalameta"; | |
version = "1.6.0"; | |
sha256 = "1ynwsn96dgjn6nwqln5r3vrkvpsv23aza06lss3asd6ynbfijaxl"; | |
} | |
{ | |
# eamodio.gitlens | |
name = "gitlens"; | |
publisher = "eamodio"; | |
version = "10.1.1"; | |
sha256 = "0kr8wdpfv6n61frpxwrs2fr07x0879h7r3hd61v36q3k8cajb3py"; | |
} | |
{ | |
# yzhang.markdown-all-in-one | |
name = "markdown-all-in-one"; | |
publisher = "yzhang"; | |
version = "2.5.1"; | |
sha256 = "0df18dckqw2zzl266fss91dk1f9zbz9x5wlpiyrb37rybzaw7mc7"; | |
} | |
{ | |
# marlon407.code-groovy | |
name = "code-groovy"; | |
publisher = "marlon407"; | |
version = "0.1.2"; | |
sha256 = "1gs0p7hwfzbzh6wpy0xlr4cn74pjj03aa1lcwdvnxpjb4sd7hd7j"; | |
} | |
# 2019-11-18: failing | |
{ | |
# tabeyti.jenkins-jack | |
name = "jenkins-jack"; | |
publisher = "tabeyti"; | |
version = "1.0.0"; | |
sha256 = "1c7k1mhcfw6zj95cajs1d75aa9qlz5ksa5rf1c03ifc81p83m75q"; | |
} | |
{ | |
# ext install alefragnani.jenkins-status | |
name = "jenkins-status"; | |
publisher = "alefragnani"; | |
version = "3.1.2"; | |
sha256 = "1k0db1w7pakaqhzbsjgahip4kdc1rxc668dlwj9il4ynkapvc8cf"; | |
} | |
{ | |
# csv | |
name = "rainbow-csv"; | |
publisher = "mechatroner"; | |
version = "1.3.1"; | |
sha256 = "0id9b94ygwwgmcq0hn5gr791rc7a1wpyx9s911s5680z13aa7xl1"; | |
} | |
# { | |
# name = "vsliveshare"; | |
# publisher = "MS-vsliveshare"; | |
# version = "1.0.1245"; | |
# sha256 = "0070x19sahxpci1rkxqi474izdi5ii76dk73ddvf21wgv6hj7gnn"; | |
# } | |
{ | |
# ext install MS-vsliveshare.vsliveshare-pack | |
name = "vsliveshare-pack"; | |
publisher = "MS-vsliveshare"; | |
version = "0.3.4"; | |
sha256 = "0svijjggycnw9iy7ziiixmcf83p45q0nzvhm0pvcm982hpi4dkra"; | |
} | |
{ | |
# ext install mechatroner.rainbow-csv | |
name = "intellij-idea-keybindings"; | |
publisher = "k--kato"; | |
version = "0.2.37"; | |
sha256 = "1wqds3rdqfsya5amnwfhbhnynjzx72p3jqsdsl1i32wvdi64shcv"; | |
} | |
{ | |
# ext install vscjava.vscode-java-pack | |
name = "vscode-java-pack"; | |
publisher = "vscjava"; | |
version = "0.8.0"; | |
sha256 = "1iq8wq8dzm99cp8y8d6p03ad0qki2ndg5vlwsmns46kz93q8g43b"; | |
} | |
{ | |
# ext install vscode-icons-team.vscode-icons | |
name = "vscode-icons"; | |
publisher = "vscode-icons-team"; | |
version = "9.5.0"; | |
sha256 = "1dhjpl11dqig1mvcf76bl5hia4yn4xnby07fi7rv3sys1r6bxd43"; | |
} | |
]; | |
}; | |
in { | |
# Let Home Manager install and manage itself. | |
programs.home-manager.enable = true; | |
home.sessionVariables = { | |
EDITOR = "emacs"; | |
BROWSER = "firefox"; | |
}; | |
home.packages = with pkgs; with pkgs.python37Packages; with haskellPackages; [ | |
aws | |
awscli | |
coursier | |
discord | |
gnome3.gnome-tweak-tool | |
gnome3.polari | |
konversation | |
kubernetes | |
minikube | |
# haskell | |
cabal-install | |
cabal2nix | |
cachix | |
ghc # ghc-8.6.5 at the moment | |
hie | |
haskellPackages.hoogle | |
libffi | |
stack | |
xmonad | |
xmonad-extras | |
xmonad-contrib | |
# xmonad-with-packages | |
pass | |
hunspellDicts.en-us-large | |
hunspellDicts.es-any | |
isync | |
notmuch | |
groovy | |
libpng | |
libreoffice-fresh | |
meld | |
(import ./mermaid.nix) | |
nodePackages.js-beautify | |
plantuml | |
# python37Packages | |
pypi2nix | |
gobjectIntrospection | |
gtk3 | |
(python37.withPackages (ps: with ps; [ | |
ipython | |
jupyter | |
# python37Packages.jupyterlab | |
matplotlib | |
mu | |
numpy | |
pandas | |
pip | |
pelican | |
python | |
pygobject3 | |
setuptools | |
scipy | |
])) | |
scalafmt | |
sublime | |
typora | |
(vscodeWithExtensions.overrideDerivation (old: { | |
postFixup = '' | |
wrapProgram $out/bin/code --prefix PATH : ${lib.makeBinPath [hie]} | |
''; | |
})) | |
zip | |
zotero | |
]; | |
manual.html.enable = true; | |
manual.json.enable = true; | |
manual.manpages.enable = true; | |
programs.emacs = { | |
enable = true; | |
extraPackages = epkgs: with epkgs; [ | |
(pkgs.runCommand "default.el" {} '' | |
mkdir -p $out/share/emacs/site-lisp | |
cp ${myEmacsConfig} $out/share/emacs/site-lisp/default.el | |
'') | |
csv-mode | |
helm | |
lsp-haskell | |
multiple-cursors | |
go-mode | |
groovy-mode | |
json-mode | |
lua-mode | |
neotree | |
nix-mode | |
# pdf-tools https://github.com/NixOS/nixpkgs/issues/11503#issuecomment-397072014 | |
# https://github.com/jwiegley/nix-config/blob/master/overlays/10-emacs.nix#L536 | |
pdf-tools | |
use-package | |
# scala/metals. See https://scalameta.org/metals/docs/editors/emacs.html | |
company-lsp | |
flycheck | |
lsp-mode | |
lsp-ui | |
scala-mode | |
sbt-mode | |
yasnippet | |
# python | |
melpaPackages.lsp-python-ms | |
melpaPackages.ob-ipython | |
# Latex and text edition | |
auctex | |
melpaPackages.markdown-mode | |
melpaPackages.mermaid-mode | |
melpaPackages.ob-mermaid | |
melpaPackages.pandoc-mode | |
melpaPackages.plantuml-mode | |
ob-go | |
org | |
org-bullets | |
org-pomodoro | |
vimish-fold | |
yaml-mode | |
undo-tree | |
web-beautify | |
]; | |
overrides = self: super: | |
let | |
inherit (pkgs) fetchurl fetchFromGitHub stdenv; | |
inherit (stdenv) lib; | |
in { | |
lua-mode = lib.overrideDerivation super.lua-mode (attrs: rec { | |
name = "lua-mode-${version}"; | |
version = "20190113.1350"; | |
src = fetchFromGitHub { | |
owner = "immerrr"; | |
repo = "lua-mode"; | |
rev = "95c64bb5634035630e8c59d10d4a1d1003265743"; | |
sha256 = "1mra4db25ds64526dsj8m5yv0kfq3lgggjh1x6xmqypdaryddbcp"; | |
fetchSubmodules = true; | |
# date = 2019-01-13T13:50:39+03:00; | |
}; | |
}); | |
scala-mode = self.melpaBuild { | |
pname = "scala-mode"; | |
ename = "scala-mode"; | |
version = "20191010"; | |
src = fetchFromGitHub { | |
owner = "hvesalai"; | |
repo = "emacs-scala-mode"; | |
rev = "44772cbf1e1ade52bc5066555ff0aed68569aaec"; | |
sha256 = "0xnsyrsardsmjyj563dkl03f5d6g2syng1x721i0w36qkiqwcqr7"; | |
# date = 2019-07-27T13:10:42-04:00; | |
}; | |
preBuild = '' | |
make LDFLAGS="-L ${self.pg}/share/emacs/site-lisp/elpa/$(echo ${self.pg.name} | sed 's/^emacs-//')" | |
''; | |
recipe = fetchurl { | |
url = "https://raw.githubusercontent.com/melpa/melpa/master/recipes/scala-mode"; | |
sha256 = "1wnl3ily5qsff36z6fkk86m58w591yc3m2nka22vslafj8m8gwl8"; | |
name = "recipe"; | |
}; | |
packageRequires = with self; [ emacs ]; | |
meta = { | |
homepage = "https://melpa.org/#/scala-mode"; | |
license = lib.licenses.gpl3; | |
}; | |
}; | |
}; | |
}; | |
services.emacs.enable = true; | |
#programs.firefox = { | |
programs.git = { | |
enable = true; | |
ignores = [ | |
".bloop" | |
"out" | |
"target" | |
".metals" | |
"metals.sbt" | |
]; | |
userEmail = "vargas.torres.oscar@gmail.com"; | |
userName = "Oscar Vargas Torres"; | |
}; | |
programs.jq.enable = true; | |
# programs.vscode = { | |
# enable = true; | |
# extensions = [ pkgs.vscode-extensions.bbenoist.Nix ]; | |
# haskell = { | |
# enable = true; | |
# hie.enable = true; | |
# }; | |
# userSettings = { | |
# "[nix haskell scala python]"."editor.tabSize" = 2; | |
# }; | |
# }; | |
programs.matplotlib = { | |
enable = true; | |
config = { | |
backend = "GTK3Agg"; | |
axes = { | |
grid = true; | |
facecolor = "black"; | |
edgecolor = "FF9900"; | |
}; | |
grid.color = "FF9900"; | |
}; | |
}; | |
qt.enable = true; | |
qt.platformTheme = "gnome"; | |
# nixpkgs.overlays = [ | |
# (self: super: { hie-nix = (all-hies.selection { selector = p: { inherit (p) ghc865; }; }); }) | |
# ]; | |
} |
error: Nope!
(use '--show-trace' to show detailed location information)
error: Nope!
(use '--show-trace' to show detailed location information)
/home/oscarvarto/.nix-profile/bin/home-manager: line 115: /tmp/home-manager-build.zPgMnY4RGg/news-info.sh: No such file or directory
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently failing with:
error: evaluation aborted with the following error message: 'vscode.haskell: pkgs.hie-nix missing. Please add an overlay such as:
nixpkgs.overlays = [
(self: super: { hie-nix = import ~/src/hie-nix {}; })
]