New option to fail build on unknown package
This commit is contained in:
@ -8,10 +8,13 @@
|
||||
, emacsArgs ? []
|
||||
# Additional files you wish to load prior to executing package discovery
|
||||
# Good place to place to call `advice-add` from
|
||||
, emacsLoadFiles ? [] }:
|
||||
, emacsLoadFiles ? []
|
||||
# Abort processing if a package not found in `emacsPackages`
|
||||
# Setting it to false will result in just skipping an unavailable package
|
||||
, abortOnNotFound ? false }:
|
||||
|
||||
let
|
||||
libstraight = epkgs.callPackage ./libstraight.nix { inherit epkgs; };
|
||||
libstraight = epkgs.callPackage ./libstraight.nix { inherit abortOnNotFound epkgs; };
|
||||
epkgs =
|
||||
if straight == null then
|
||||
emacsPackages.overrideScope' (self: super:
|
||||
|
@ -1,8 +1,9 @@
|
||||
{ lib, stdenv, epkgs, writeScript }:
|
||||
{ abortOnNotFound ? true,
|
||||
lib, stdenv, epkgs, writeScript }:
|
||||
|
||||
let
|
||||
inherit (builtins) filter trace;
|
||||
inherit (lib) concatMapStringsSep escapeShellArgs importJSON flatten unique optionalString;
|
||||
inherit (lib) concatMapStringsSep escapeShellArgs importJSON flatten unique optionalString warn;
|
||||
|
||||
expandDependencies = packages:
|
||||
let
|
||||
@ -39,7 +40,8 @@ let
|
||||
list = importJSON json;
|
||||
in map (x:
|
||||
if epkgs ? "${x}" then epkgs.${x}
|
||||
else (trace "XXX no attribute found for use-package ${x}") null) list;
|
||||
else if abortOnNotFound then abort "Package not available: ${x}"
|
||||
else (warn "Package not available: ${x}") null) list;
|
||||
|
||||
packagesJSON = { emacsInitFile, emacsLoadFiles, emacsArgs }: stdenv.mkDerivation {
|
||||
name = "emacs-straight-packages.json";
|
||||
|
6
setup.el
6
setup.el
@ -9,11 +9,15 @@
|
||||
(let ((pkg (if (listp recipe)
|
||||
(car recipe)
|
||||
recipe)))
|
||||
(message "straight-use-package %s %s; pkg=%s" recipe r pkg)
|
||||
(message "straight-use-package %s %s" recipe r)
|
||||
(add-to-list 'nix-straight--packages pkg))))
|
||||
(advice-add 'straight-recipes-retrieve
|
||||
:override (lambda (pkg)
|
||||
(list)))
|
||||
(advice-add 'straight-use-recipes
|
||||
:override (lambda (&rest r)
|
||||
(message "straight-use-recipes %s" r)
|
||||
))
|
||||
|
||||
(load init-file nil nil t)
|
||||
(princ (if (null nix-straight--packages)
|
||||
|
Reference in New Issue
Block a user