diff --git a/checks.nix b/checks.nix index 78b6d79..fcc5044 100644 --- a/checks.nix +++ b/checks.nix @@ -75,4 +75,7 @@ in { }; interactive = doomTest "minimal" { config = [ "default" ]; } { }; interactive-without-loader = doomTest "minimal" { config = [ "default" ]; } { profileName = ""; }; + + # Various tests of module combinations. + unpinned-org = doomTest "external-org" { app = [ [ "rss" "+org" ] ]; } { }; } diff --git a/default.nix b/default.nix index 506d4ff..804c26d 100644 --- a/default.nix +++ b/default.nix @@ -176,9 +176,10 @@ let origEPkg == esuper.elpaPackages.${name} or null || origEPkg == esuper.nongnuPackages.${name} or null); epkg = - customPackages.${name} - or (if !hasOrigEPkg || (p ? pin && isElpa) - then + if hasOrigEPkg && (pin != null -> !(isElpa || customPackages ? ${name})) + then origEPkg + else customPackages.${name} + or ( assert lib.assertMsg (isElpa || (p ? recipe && pin != null) || extraUrls ? ${name}) "${name}: not in epkgs, not elpa, no recipe or not pinned"; @@ -224,8 +225,7 @@ let # TODO: refactor out the recursive call to makePackage. # (Currently needed for dependencies on packages not in epkgs or doom.) packageRequires = map (name: eself.${name} or (makePackage name {})) reqlist; - } - else origEPkg); + }); url = if (p.recipe.host or "") == "github" && p ? recipe.repo then "https://github.com/${p.recipe.repo}" diff --git a/tests.el b/tests.el index c675f27..78c79a8 100644 --- a/tests.el +++ b/tests.el @@ -23,6 +23,13 @@ ;; The minimal test is a noop. ) +(defun test-external-org () + "Test org can be loaded and it's not built-in." + (require 'org) + (let ((path (find-library-name "org"))) + (unless (string-search "/site-lisp/" path) + (error "org-mode probably built-in: %s" path)))) + (defun test-doom () (let* ((out (getenv "out")) (test (intern-soft (format "test-%s" (getenv "testName"))))