Improve error messages for unfetchable packages
Split out the check for "pin" (which already had a dedicated check, but it was mostly unreachable) from the check for "repo URL", and make both error messages more useful. Remove a TODO while I'm there, because it looks unachievable: we should only hit these checks when using our generated derivation, which should mean we're also generating `src`, which means we really do need a pin, as Nix will otherwise refuse to fetch in pure evalution mode. For #20
This commit is contained in:
parent
ceaea0f0a7
commit
6ecd96edc3
1 changed files with 15 additions and 15 deletions
30
default.nix
30
default.nix
|
|
@ -177,25 +177,25 @@ let
|
||||||
else customPackages.${name}
|
else customPackages.${name}
|
||||||
or (
|
or (
|
||||||
assert lib.assertMsg
|
assert lib.assertMsg
|
||||||
(isElpa || (p ? recipe && pin != null) || extraUrls ? ${name})
|
(isElpa || (p ? recipe) || extraUrls ? ${name}) ''
|
||||||
"${name}: not in epkgs, not elpa, no recipe or not pinned";
|
nix-doom-emacs-unstraightened: ${name}: unable to derive repository URL:
|
||||||
|
- no recipe provided
|
||||||
|
- not an ELPA package
|
||||||
|
- not in Unstraightened's fetch-overrides.nix
|
||||||
|
|
||||||
|
If this is a custom `package!` entry in packages.el, add a `:recipe`.
|
||||||
|
'';
|
||||||
# Assume we can safely ignore (pre-)build unless we're actually
|
# Assume we can safely ignore (pre-)build unless we're actually
|
||||||
# building our own package.
|
# building our own package.
|
||||||
assert lib.assertMsg (!(p ? recipe.pre-build)) "${name}: pre-build not supported";
|
assert lib.assertMsg (!(p ? recipe.pre-build)) "${name}: pre-build not supported";
|
||||||
assert lib.assertMsg (!(p ? recipe.build)) "${name}: build not supported";
|
assert lib.assertMsg (!(p ? recipe.build)) "${name}: build not supported";
|
||||||
# TODO: lift "pin" requirement, if that turns out to be
|
assert lib.assertMsg (pin != null) ''
|
||||||
# necessary or at least desirable. Requires figuring out why
|
nix-doom-emacs-unstraightened: ${name}: not in nixpkgs or emacs-overlay, not pinned.
|
||||||
# melpa2nix requires `commit`. Not a priority because if it's
|
All packages must be pinned so they can be fetched deterministically.
|
||||||
# not in epkgs we'd need a recipe passed in, and it's uncommon
|
|
||||||
# for Doom to pass in a recipe without pinning.
|
If this is a custom `package!` entry in your packages.el, add a `:pin`.
|
||||||
#
|
If it is a `package!` in Doom, add an entry to Unstraightened's fetch-overrides.nix.
|
||||||
# Doom does currently have unpinned packages with an explicit
|
'';
|
||||||
# recipe, but they're in epkgs (popon and flymake-popon) so it
|
|
||||||
# should be ok. Users might do this to pull in a custom package
|
|
||||||
# they don't care about pinning, though: we may want to support
|
|
||||||
# that.
|
|
||||||
assert lib.assertMsg (pin != null)
|
|
||||||
"${name}: not in epkgs and not pinned. This is not yet supported.";
|
|
||||||
# epkgs.*Build helpers take an attrset, they do not support
|
# epkgs.*Build helpers take an attrset, they do not support
|
||||||
# mkDerivation's fixed-point evaluation (`finalAttrs`).
|
# mkDerivation's fixed-point evaluation (`finalAttrs`).
|
||||||
# If they did, the buildInputs stuff should use finalAttrs.src.
|
# If they did, the buildInputs stuff should use finalAttrs.src.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue