Skip to content

Commit

Permalink
Use evalPkgs to ensure nix flake check still works
Browse files Browse the repository at this point in the history
Related to NixOS/nix#4265
  • Loading branch information
matthewbauer committed Dec 1, 2020
1 parent 3a5476b commit 83b9ab9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
20 changes: 11 additions & 9 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -4398,9 +4398,10 @@ we have some options that can be provided...
, config ? {}
, overlays ? []
, pkgs ? import <nixpkgs> { inherit crossSystem system config overlays; }
, evalPkgs ? pkgs
, ensure ? f: n: f
, small ? pkgs.config.bauer.small or true
, emacs-overlay ? { overlay = import (pkgs.fetchFromGitHub {
, emacs-overlay ? { overlay = import (evalPkgs.fetchFromGitHub {
owner = "nix-community";
repo = "emacs-overlay";
rev = "28c31e0ae90b6fcf51f2d02c5d43fe1715dc6393";
Expand Down Expand Up @@ -4506,18 +4507,18 @@ Emacs configuration. use-package-list generates this list automatically.

#+BEGIN_SRC nix
package-list =
runCommand "package-list" {
buildInputs = [ customEmacsPackages.emacs ];
evalPkgs.runCommand "package-list" {
buildInputs = [ evalPkgs.emacs ];
} ''
#+END_SRC

#+BEGIN_SRC nix
emacs --batch --quick \
-L ${customEmacsPackages.use-package
-L ${evalPkgs.emacsPackages.use-package
}/share/emacs/site-lisp/elpa/use-package-* \
-L ${customEmacsPackages.delight
-L ${evalPkgs.emacsPackages.delight
}/share/emacs/site-lisp/elpa/delight-* \
-L ${customEmacsPackages.bind-key
-L ${evalPkgs.emacsPackages.bind-key
}/share/emacs/site-lisp/elpa/bind-key-* \
-l ${ensure ./site-lisp/set-defaults.el
"site-lisp/set-defaults.el"} \
Expand Down Expand Up @@ -5327,8 +5328,9 @@ in {
packages = forAllSystems (system: {
bauer = let
pkgs = nixpkgsFor.${system};
in import (pkgs.runCommand "README" {
buildInputs = with pkgs; [ emacs git ];
evalPkgs = nixpkgsFor.x86_64-linux;
in import (evalPkgs.runCommand "README" {
buildInputs = with evalPkgs; [ emacs git ];
} (''
install -D ${./README.org} $out/README.org
cd $out
Expand All @@ -5337,7 +5339,7 @@ in {
-l ob-tangle \
--eval "(org-babel-tangle-file \"README.org\")" > /dev/null
cp bauer.nix default.nix
'')) { inherit pkgs emacs-overlay; };
'')) { inherit pkgs emacs-overlay evalPkgs; };
});

defaultPackage = forAllSystems (system: self.packages.${system}.bauer);
Expand Down
7 changes: 4 additions & 3 deletions flake.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 83b9ab9

Please sign in to comment.