Skip to content
A nix function for customizing Emacs
Emacs Lisp Nix
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


This function will give you an Emacs derivation which loads the given script alongside with all the packages mentioned in it (doom-themes, undo-tree and magit in this case):

pkgs = import <nixpkgs> {};
emacsWithConfig = pkgs.callPackage 
  (builtins.fetchTarball "")
emacsWithConfig ''
  (require 'use-package)

  (use-package doom-themes
    (load-theme 'doom-molokai t))

  (use-package undo-tree
    :defer 2
    (setq undo-tree-visualizer-timestamps t)

  (use-package magit
    ("C-x m" . magit-status))

To be more precise, it will:

  1. Parse the given script to find the use-package usages and collect the required packages.
  2. Use pkgs.emacsWithPackages to get an emacs distribution with the required packages.
  3. Bytecompile the given script.
  4. Wrap pkgs.emacs to load the given script by default.
You can’t perform that action at this time.