Commit bfc5ff3a5613
Changed files (9)
overlays
profiles
envs/base.nix
@@ -3,6 +3,8 @@
let home_directory = builtins.getEnv "HOME"; in
rec {
+
+ imports = [ ../profiles/overlays.nix ];
programs = {
home-manager = {
enable = true;
envs/emacs.nix
@@ -1,57 +1,9 @@
{ pkgs, config, lib, melpaBuild, ... }:
-
-let
-compileEmacsFiles = pkgs.callPackage ./emacs/builder.nix;
-/*
-counsel-org-clock= compileEmacsFiles {
- name = "counsel-org-clock";
- src = pkgs.fetchFromGitHub {
- owner = "akirak";
- repo = "counsel-org-clock";
- rev = "18d68c7ce7b461bb7055ff873e39d5849a971417";
- sha256 = "0c9yiwrc6apxrhc8dyfdgs6q2m2l8rd92rwmywci7ivhcpp4cadi";
- };
-};
-*/
-
-bookmark-plus = compileEmacsFiles {
- name = "bookmark-plus";
- src = pkgs.fetchFromGitHub {
- owner = "emacsmirror";
- repo = "bookmark-plus";
- rev = "954d48092247e9fd461d310fd9fc3c0d545362d5";
- sha256 = "0c9yiwrc6apxrrc8dyfdgs6q2m2l8rd92rwmywci7ivhcpp4cadi";
- };
-};
-
-/*
-minions = pkgs.melpaBuild {
- pname = "minions";
- version = "20180321.749";
- src = pkgs.fetchFromGitHub {
- owner = "tarsius";
- repo = "minions";
- rev = "acac7fb0b04ffdf243775231690956d163474177";
- sha256 = "1065asbg1h2chd34cbja2pir93r5y8gp3wv3jv6sf5csa6yqk6c7";
- };
- recipeFile = pkgs.fetchurl {
- url = "https://raw.githubusercontent.com/melpa/melpa/e5cfaa4b5fda97054d45691fad9d79b559f2df14/recipes/minions";
- sha256 = "1065asbg1h2chd34cbja2pir93r5y8gp3wv3jv6sf5csa6yqk6ch";
- name = "minions";
- };
- packageRequires = [ pkgs.emacs ];
- meta = {
- homepage = "https://melpa.org/#/elfeed";
- license = lib.licenses.free;
- };
-};
-*/
-
-in {
-
+{
programs.emacs = {
enable = true;
+ #package = pkgs.myEmacs;
extraPackages = epkgs: with epkgs; [
ace-window
aggressive-indent
@@ -60,19 +12,17 @@ in {
auto-yasnippet
avy
bm
- bookmark-plus
command-log-mode
company
company-emoji
company-ghc
company-go
company-lsp
- company-nixos-options
+ (with melpaPackages; [ company-nixos-options ])
company-restclient
company-shell
counsel
counsel-gtags
- # counsel-org-clock # FIXME
counsel-projectile
# counsel-spotify
counsel-tramp
@@ -92,15 +42,17 @@ in {
elpy
engine-mode
eshell-bookmark
+ (with melpaPackages; [
eshell-prompt-extras
esh-autosuggest
+ ])
exec-path-from-shell
expand-region
eyebrowse
- ez-query-replace
+ (with melpaPackages; [ ez-query-replace ])
fancy-narrow
fish-mode
- fish-completion
+ (with melpaPackages; [ fish-completion ])
flycheck
flycheck-clojure
flycheck-haskell
@@ -117,16 +69,18 @@ in {
gitattributes-mode
gitconfig-mode
gitignore-mode
- go-mode
- go-add-tags
- # go-dlv
- go-eldoc
- go-errcheck
- go-fill-struct
- go-guru
- # go-impl
- gorepl-mode
- go-tag
+ (with melpaPackages; [
+ go-add-tags
+ # go-dlv
+ go-eldoc
+ go-errcheck
+ go-fill-struct
+ go-guru
+ # go-impl
+ go-mode
+ gorepl-mode
+ go-tag
+ ])
groovy-mode
hardhat
haskell-mode
@@ -142,9 +96,9 @@ in {
ibuffer-projectile
ibuffer-sidebar
iedit
- imenu-list
+ (with melpaPackages; [ imenu-list ])
ivy
- ivy-historian
+ (with melpaPackages; [ ivy-historian ])
ivy-hydra
ivy-pass
ivy-rich
@@ -171,11 +125,14 @@ in {
markdown-mode
mc-extras
# minions # FIXME
+ #(with melpaPackages; [ minions ])
multiple-cursors
- nix-buffer
- nix-mode
- nix-sandbox
- nixos-options
+ (with melpaPackages; [
+ nix-buffer
+ nix-mode
+ nix-sandbox
+ nixos-options
+ ])
no-littering
olivetti
ob-go
@@ -213,7 +170,7 @@ in {
smart-jump
smart-newline
smart-region
- smartparens
+ (with melpaPackages; [ smartparens ])
solaire-mode
sort-words
sos
@@ -224,8 +181,9 @@ in {
tide
toml-mode
typescript-mode
- undo-tree
- use-package
+ (with melpaPackages; [ undo-tree ])
+ (with melpaPackages; [ use-package ])
+ # use-package
vdiff
visual-fill-column
visual-regexp
overlays/emacs/patches/pass.patch
@@ -0,0 +1,11 @@
+--- a/pass.el
++++ b/pass.el
+@@ -216,7 +216,7 @@ When called with a prefix argument ARG, visit the entry file."
+ It creates an empty entry file, and visit it."
+ (let ((entry (format "%s.gpg" (read-string "Password entry: ")))
+ (default-directory (password-store-dir)))
+- (make-directory (file-name-directory entry) t)
++ ;; (make-directory (file-name-directory entry) t)
+ (find-file (expand-file-name entry (password-store-dir)))))
+
+ (defun pass-insert-generated ()
overlays/emacs/patches/password-store.patch
@@ -0,0 +1,26 @@
+diff -U3 -w -r /nix/store/d6j6b3q4611ihv2vid3l5sm432rzybph-source/contrib/emacs/password-store.el ./contrib/emacs/password-store.el
+--- /nix/store/d6j6b3q4611ihv2vid3l5sm432rzybph-source/contrib/emacs/password-store.el 1969-12-31 16:00:01.000000000 -0800
++++ ./contrib/emacs/password-store.el 2018-01-29 15:03:11.000000000 -0800
+@@ -224,15 +224,20 @@
+ (message "%s" (password-store--run-init (split-string gpg-id))))
+
+ ;;;###autoload
+-(defun password-store-insert (entry password)
++(defun password-store-insert (entry login password)
+ "Insert a new ENTRY containing PASSWORD."
+ (interactive (list (read-string "Password entry: ")
++ (read-string "Login: ")
+ (read-passwd "Password: " t)))
+ (message "%s" (shell-command-to-string
++ (if (string= "" login)
+ (format "echo %s | %s insert -m -f %s"
+ (shell-quote-argument password)
+ password-store-executable
+- (shell-quote-argument entry)))))
++ (shell-quote-argument entry))
++ (format "echo -e '%s\nlogin: %s' | %s insert -m -f %s"
++ password login password-store-executable
++ (shell-quote-argument entry))))))
+
+ ;;;###autoload
+ (defun password-store-generate (entry &optional password-length)
overlays/emacs/builder.nix
@@ -0,0 +1,32 @@
+{ stdenv
+, emacs
+, name
+, src
+, buildInputs ? []
+, patches ? []
+}:
+
+stdenv.mkDerivation {
+ name = name;
+ src = src;
+ unpackCmd = ''
+ test -f "${src}" && mkdir el && cp -p ${src} el/${name}
+ '';
+ patches = patches;
+ buildInputs = [ emacs ] ++ buildInputs;
+ buildPhase = ''
+ ARGS=$(find ${stdenv.lib.concatStrings
+ (builtins.map (arg: arg + "/share/emacs/site-lisp ") buildInputs)} \
+ -type d -exec echo -L {} \;)
+ ${emacs}/bin/emacs -Q -nw -L . $ARGS --batch -f batch-byte-compile *.el
+ '';
+ installPhase = ''
+ mkdir -p $out/share/emacs/site-lisp
+ install *.el* $out/share/emacs/site-lisp
+ '';
+ meta = {
+ description = "Emacs projects from the Internet that just compile .el files";
+ homepage = http://www.emacswiki.org;
+ platforms = stdenv.lib.platforms.all;
+ };
+}
overlays/sbr.emacs.nix
@@ -0,0 +1,110 @@
+self: pkgs: rec {
+
+ myEmacs = customEmacsPackages.emacsWithPackages pkgs.emacs;
+ emacsPackagesNg = pkgs.emacsPackagesNgGen pkgs.emacs;
+ customEmacsPackages =
+ emacsPackagesNg.overrideScope (myEmacsPackageOverrides pkgs.emacs);
+
+ compileEmacsFiles = pkgs.callPackage ./emacs/builder.nix;
+
+ fetchFromEmacsWiki = pkgs.callPackage ({ fetchurl, name, sha256 }:
+ fetchurl {
+ inherit sha256;
+ url = "https://www.emacswiki.org/emacs/download/" + name;
+ });
+
+ compileEmacsWikiFile = { name, sha256, buildInputs ? [], patches ? [] }:
+ compileEmacsFiles {
+ inherit name buildInputs patches;
+ src = fetchFromEmacsWiki { name = name; sha256 = sha256; };
+ };
+
+ compileLocalFile = name: compileEmacsFiles {
+ inherit name; src = ./emacs + ("/" + name);
+ };
+
+ myEmacsPackageOverrides = emacs: super: self: with self;
+ let withPatches = pkg: patches:
+ overrideDerivation pkg (attrs: { inherit patches; }); in
+
+ super.melpaPackages // {
+
+ inherit (pkgs) fetchurl fetchgit fetchFromGitHub;
+ inherit (pkgs) stdenv;
+ inherit (stdenv) mkDerivation lib;
+ inherit (lib) overrideDerivation;
+
+ /*
+ edit-env = compileLocalFile "edit-env.el";
+ edit-var = compileLocalFile "edit-var.el";
+ ox-extra = compileLocalFile "ox-extra.el";
+ rs-gnus-summary = compileLocalFile "rs-gnus-summary.el";
+ supercite = compileLocalFile "supercite.el";
+ */
+
+ pass = withPatches melpaPackages.pass
+ [ ./emacs/patches/pass.patch ];
+
+ password-store = withPatches melpaPackages.password-store
+ [ ./emacs/patches/password-store.patch ];
+
+ minions = melpaBuild {
+ pname = "minions";
+ version = "20180321.749";
+ src = fetchFromGitHub {
+ owner = "tarsius";
+ repo = "minions";
+ rev = "acac7fb0b04ffdf243775231690956d163474177";
+ sha256 = "1065asbg1h2chd34cbja2pir93r5y8gp3wv3jv6sf5csa6yqk6c7";
+ };
+ recipeFile = fetchurl {
+ url = "https://raw.githubusercontent.com/melpa/melpa/e5cfaa4b5fda97054d45691fad9d79b559f2df14/recipes/minions";
+ sha256 = "1065asbg1h2chd34cbja2pir93r5y8gp3wv3jv6sf5csa6yqk6ch";
+ name = "minions";
+ };
+ packageRequires = [ emacs ];
+ meta = {
+ homepage = "https://melpa.org/#/minions";
+ license = lib.licenses.free;
+ };
+ };
+
+ counsel-org-clock = melpaBuild {
+ pname = "counsel-org-clock";
+ version = "20180501.1021";
+ src = fetchFromGitHub {
+ owner = "akirak";
+ repo = "counsel-org-clock";
+ rev = "1b57912f117c8689224faa40842739eb6624d935";
+ sha256 = "1065asbg1h2chd34cbja2pir93r5y8gp3wv3jv6sf5csa6yqk6h7";
+ };
+ recipeFile = fetchurl {
+ url = "https://raw.githubusercontent.com/melpa/melpa/d21e10ba82b4ae0f8101031be16bc5f7e80ba5d5/recipes/counsel-org-clock";
+ sha256 = "1065asbg1h2chd34cbja2pir93r5y8gp3wv3jv6sf5csa6yqk6cf";
+ name = "counsel-org-clock";
+ };
+ packageRequires = [ emacs ];
+ meta = {
+ homepage = "https://melpa.org/#/counsel-org-clock";
+ license = lib.licenses.free;
+ };
+ };
+
+ ascii = compileEmacsWikiFile {
+ name = "ascii.el";
+ sha256 = "05fjsj5nmc05cmsi0qj914dqdwk8rll1d4dwhn0crw36p2ivql75";
+ # date = 2018-02-21T17:21:27-0800;
+ };
+
+ emacs-load-time = compileEmacsFiles {
+ name = "emacs-load-time";
+ src = fetchFromGitHub {
+ owner = "fniessen";
+ repo = "emacs-load-time";
+ rev = "9d31686a76e9792bd06e49ff77c662065ded015c";
+ sha256 = "0zhrfidcxqfld7y67pysdlcvrprrka9sq8065ygqx5yxjb7mxs32";
+ # date = 2014-10-10T16:52:58+02:00;
+ };
+ };
+ };
+}
overlays/sbr.overlay.nix
@@ -1,4 +1,5 @@
self: super: {
+
ape = import ../pkgs/ape { inherit (self) stdenv lib buildGoPackage fetchFromGitHub; };
clasp = import ../pkgs/clasp { inherit (self) stdenv lib buildGoPackage fetchFromGitHub; };
tuck = import ../pkgs/tuck { inherit (self) stdenv lib buildGoPackage fetchFromGitHub; };
profiles/default.nix
@@ -3,6 +3,7 @@
{
imports = [
./users.nix
+ ./overlays.nix
../pkgs/home-manager/nixos
];
boot.loader.systemd-boot.enable = true;
@@ -44,14 +45,6 @@
'';
};
nixpkgs = {
- overlays = [
- (import ../overlays/sbr.overlay.nix)
- # add third-party packages from outside the nixpkgs tree
- (self: super: {
- nix-beautify = import ../pkgs/nix-beautify { inherit pkgs; };
- home-manager = import ../pkgs/home-manager { inherit pkgs; };
- })
- ];
config = {
allowUnfree = true;
};
profiles/overlays.nix
@@ -0,0 +1,15 @@
+{ config, pkgs, ... }:
+
+{
+ nixpkgs = {
+ overlays = [
+ (import ../overlays/sbr.overlay.nix)
+ (import ../overlays/sbr.emacs.nix)
+ # add third-party packages from outside the nixpkgs tree
+ (self: super: {
+ nix-beautify = import ../pkgs/nix-beautify { inherit pkgs; };
+ home-manager = import ../pkgs/home-manager { inherit pkgs; };
+ })
+ ];
+ };
+}