Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package not available: idris2-mode #259

Closed
ribosomerocker opened this issue Sep 1, 2022 · 14 comments
Closed

Package not available: idris2-mode #259

ribosomerocker opened this issue Sep 1, 2022 · 14 comments

Comments

@ribosomerocker
Copy link

Hello :) I should say that I'm kind of surprised I got to this point, (no offense, this is criticism in hope to inspire improving the documentation), the docs sure appear like they didn't want me to. (Specifically, this part is very confusing. it should be specified that you mean packages = inputs.nix-doom-emacs; here.

Anyways, onto my main problem: I add a module into my Doom folder, at modules/lang/idris2, mainly because Doom Emacs doesn't have an Idris2 module, and I have 2 files there:

doom/modules/lang/idris2/config.el
;;; lang/idris2/config.el -*- lexical-binding: t; -*-

(use-package! idris2-mode
  :mode ("\\.l?idr\\'" . idris2-mode)
  :config

  (after! lsp-mode
    (add-to-list 'lsp-language-id-configuration '(idris2-mode . "idris2"))

    (lsp-register-client
     (make-lsp-client
      :new-connection (lsp-stdio-connection "idris2-lsp")
      :major-modes '(idris2-mode)
      :server-id 'idris2-lsp)))

  (add-hook 'idris2-mode-hook #'lsp!))
doom/modules/lang/idris2/packages.el
;; -*- no-byte-compile: t; -*-
;;; lang/idris2/packages.el

(package! idris2-mode :recipe (:host github :repo "idris-community/idris2-mode"))

And, finally, I have :lang idris2 in my init.el file. The big issue though, is that nix-doom-emacs doesn't seem to want to use these settings to fetch the repository (this extension isn't on ELPA, and there's also no documentation about how to install extensions that aren't on ELPA, from Git...), and errors with:

error: evaluation aborted with the following error message: 'Package not available: idris2-mode' (THIS IS THE VERY LONG TRACE)
error: evaluation aborted with the following error message: 'Package not available: idris2-mode'

       … while evaluating anonymous lambda

       at /nix/store/a7m15v9ndw92ckanbaw1g5nchi5d3qah-source/libstraight.nix:46:13:

           45|       list = importJSON json;
           46|     in map (x:
             |             ^
           47|       if epkgs ? "${x}" then epkgs.${x}

       … from call site

       … while evaluating 'flatten'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/lists.nix:138:13:

          137|   */
          138|   flatten = x:
             |             ^
          139|     if isList x

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/lists.nix:140:24:

          139|     if isList x
          140|     then concatMap (y: flatten y) x
             |                        ^
          141|     else [x];

       … while evaluating anonymous lambda

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/lists.nix:140:21:

          139|     if isList x
          140|     then concatMap (y: flatten y) x
             |                     ^
          141|     else [x];

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/lists.nix:140:10:

          139|     if isList x
          140|     then concatMap (y: flatten y) x
             |          ^
          141|     else [x];

       … while evaluating 'flatten'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/lists.nix:138:13:

          137|   */
          138|   flatten = x:
             |             ^
          139|     if isList x

       … from call site

       at /nix/store/a7m15v9ndw92ckanbaw1g5nchi5d3qah-source/libstraight.nix:14:12:

           13|           [ x ] ++ withDeps x.propagatedBuildInputs
           14|         ) (flatten p);
             |            ^
           15|    in (unique (filter (d: d ? ename) (flatten (withDeps packages))));

       … while evaluating 'withDeps'

       at /nix/store/a7m15v9ndw92ckanbaw1g5nchi5d3qah-source/libstraight.nix:10:18:

            9|     let
           10|       withDeps = p:
             |                  ^
           11|         map (x:

       … from call site

       at /nix/store/a7m15v9ndw92ckanbaw1g5nchi5d3qah-source/libstraight.nix:15:48:

           14|         ) (flatten p);
           15|    in (unique (filter (d: d ? ename) (flatten (withDeps packages))));
             |                                                ^
           16|

       … while evaluating 'flatten'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/lists.nix:138:13:

          137|   */
          138|   flatten = x:
             |             ^
          139|     if isList x

       … from call site

       at /nix/store/a7m15v9ndw92ckanbaw1g5nchi5d3qah-source/libstraight.nix:15:39:

           14|         ) (flatten p);
           15|    in (unique (filter (d: d ? ename) (flatten (withDeps packages))));
             |                                       ^
           16|

       … while evaluating 'expandDependencies'

       at /nix/store/a7m15v9ndw92ckanbaw1g5nchi5d3qah-source/libstraight.nix:8:24:

            7|
            8|   expandDependencies = packages:
             |                        ^
            9|     let

       … from call site

       at /nix/store/a7m15v9ndw92ckanbaw1g5nchi5d3qah-source/libstraight.nix:40:54:

           39|       mkdir -p ${repo}
           40|       ${(concatMapStringsSep "\n" (installPkg repo) (expandDependencies packages))}
             |                                                      ^
           41|     '';

       … while evaluating 'concatMapStringsSep'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/strings.nix:111:5:

          110|     # List of input strings
          111|     list: concatStringsSep sep (map f list);
             |     ^
          112|

       … from call site

       at /nix/store/a7m15v9ndw92ckanbaw1g5nchi5d3qah-source/libstraight.nix:40:10:

           39|       mkdir -p ${repo}
           40|       ${(concatMapStringsSep "\n" (installPkg repo) (expandDependencies packages))}
             |          ^
           41|     '';

       … while evaluating the attribute 'text' of the derivation 'install-repo'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/pkgs/stdenv/generic/make-derivation.nix:270:7:

          269|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          270|       name =
             |       ^
          271|         let

       … while evaluating the attribute 'installPhase' of the derivation 'straight-emacs-env'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/pkgs/stdenv/generic/make-derivation.nix:270:7:

          269|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          270|       name =
             |       ^
          271|         let

       … while evaluating the attribute 'buildCommand' of the derivation 'emacs-pgtk-native-comp-with-packages-20220828.0'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/pkgs/stdenv/generic/make-derivation.nix:270:7:

          269|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          270|       name =
             |       ^
          271|         let

       … while evaluating 'id'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/trivial.nix:14:5:

           13|     # The value to return
           14|     x: x;
             |     ^
           15|

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/generators.nix:272:47:

          271|           let
          272|             evalNext = x: mapAny (depth + 1) (transform (depth + 1) x);
             |                                               ^
          273|           in

       … while evaluating anonymous lambda

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/generators.nix:270:40:

          269|           else id;
          270|         mapAny = with builtins; depth: v:
             |                                        ^
          271|           let

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/generators.nix:272:27:

          271|           let
          272|             evalNext = x: mapAny (depth + 1) (transform (depth + 1) x);
             |                           ^
          273|           in

       … while evaluating 'evalNext'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/generators.nix:272:24:

          271|           let
          272|             evalNext = x: mapAny (depth + 1) (transform (depth + 1) x);
             |                        ^
          273|           in

       … from call site

       … while evaluating 'go'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/generators.nix:292:18:

          291|     let
          292|     go = indent: v: with builtins;
             |                  ^
          293|     let     isPath   = v: typeOf v == "path";

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/options.nix:331:10:

          330|       prettyEval = builtins.tryEval
          331|         (lib.generators.toPretty { }
             |          ^
          332|           (lib.generators.withRecursion { depthLimit = 10; throwOnDepthLimit = false; } def.value));

       … while evaluating anonymous lambda

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/options.nix:327:38:

          326|
          327|   showDefs = defs: concatMapStrings (def:
             |                                      ^
          328|     let

       … from call site

       … while evaluating 'concatMapStrings'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/strings.nix:54:25:

           53|   */
           54|   concatMapStrings = f: list: concatStrings (map f list);
             |                         ^
           55|

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/options.nix:327:20:

          326|
          327|   showDefs = defs: concatMapStrings (def:
             |                    ^
          328|     let

       … while evaluating 'showDefs'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/options.nix:327:14:

          326|
          327|   showDefs = defs: concatMapStrings (def:
             |              ^
          328|     let

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/options.nix:180:105:

          179|     else assert length defs > 1;
          180|       throw "The option `${showOption loc}' is defined multiple times.\n${message}\nDefinition values:${showDefs defs}";
             |                                                                                                         ^
          181|

       … while evaluating 'mergeUniqueOption'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/options.nix:176:41:

          175|
          176|   mergeUniqueOption = { message }: loc: defs:
             |                                         ^
          177|     if length defs == 1

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/types.nix:388:19:

          387|       merge = loc: defs:
          388|         let res = mergeOneOption loc defs;
             |                   ^
          389|         in if builtins.isPath res || (builtins.isString res && ! builtins.hasContext res)

       … while evaluating 'merge'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/types.nix:387:20:

          386|       check = x: isDerivation x || isStorePath x;
          387|       merge = loc: defs:
             |                    ^
          388|         let res = mergeOneOption loc defs;

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:787:59:

          786|       if isDefined then
          787|         if all (def: type.check def.value) defsFinal then type.merge loc defsFinal
             |                                                           ^
          788|         else let allInvalid = filter (def: ! type.check def.value) defsFinal;

       … while evaluating the attribute 'mergedValue'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:785:5:

          784|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
          785|     mergedValue =
             |     ^
          786|       if isDefined then

       … while evaluating the option `home-manager.users.mon.programs.emacs.package':

       … while evaluating the attribute 'value'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:751:9:

          750|     in warnDeprecation opt //
          751|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          752|         inherit (res.defsFinal') highestPrio;

       … while evaluating anonymous lambda

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:302:72:

          301|           # For definitions that have an associated option
          302|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                                                                        ^
          303|

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/attrsets.nix:401:20:

          400|               then recurse (path ++ [name]) value
          401|               else f (path ++ [name]) value;
             |                    ^
          402|         in mapAttrs g;

       … while evaluating 'g'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/attrsets.nix:398:19:

          397|           g =
          398|             name: value:
             |                   ^
          399|             if isAttrs value && cond value

       … from call site

       … while evaluating the attribute 'emacs'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/pkgs/top-level/emacs-packages.nix:75:5:

           74|     # Propagate overriden scope
           75|     emacs = emacs'.overrideAttrs(old: {
             |     ^
           76|       passthru = (old.passthru or {}) // {

       … while evaluating the attribute 'meta'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/pkgs/build-support/emacs/wrapper.nix:186:20:

          185|
          186|     inherit (emacs) meta;
             |                    ^
          187|   }

       … while evaluating the attribute 'meta.outputsToInstall'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/pkgs/stdenv/generic/make-derivation.nix:506:13:

          505|
          506|      inherit meta passthru overrideAttrs;
             |             ^
          507|    } //

       … while evaluating the attribute 'passAsFile'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/pkgs/build-support/buildenv/default.nix:77:5:

           76|     # XXX: The size is somewhat arbitrary
           77|     passAsFile = if builtins.stringLength pkgs >= 128*1024 then [ "pkgs" ] else [ ];
             |     ^
           78|   }

       … while evaluating the attribute 'passAsFile' of the derivation 'home-manager-path'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/pkgs/stdenv/generic/make-derivation.nix:270:7:

          269|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          270|       name =
             |       ^
          271|         let

       … while evaluating the attribute 'value'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:586:44:

          585|       defnsByName' = byName "config" (module: value:
          586|           [{ inherit (module) file; inherit value; }]
             |                                            ^
          587|         ) configs;

       … while evaluating 'dischargeProperties'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:837:25:

          836|   */
          837|   dischargeProperties = def:
             |                         ^
          838|     if def._type or "" == "merge" then

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:766:137:

          765|         defs' = concatMap (m:
          766|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
             |                                                                                                                                         ^
          767|         ) defs;

       … while evaluating definitions from `/nix/store/gby2davr5n2hsxf1rfl6gaf8i17m71ff-source/modules/home-environment.nix':

       … while evaluating anonymous lambda

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:765:28:

          764|         # Process mkMerge and mkIf properties.
          765|         defs' = concatMap (m:
             |                            ^
          766|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:765:17:

          764|         # Process mkMerge and mkIf properties.
          765|         defs' = concatMap (m:
             |                 ^
          766|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … while evaluating the attribute 'values'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:878:7:

          877|     in {
          878|       values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
             |       ^
          879|       inherit highestPrio;

       … while evaluating the attribute 'values'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:779:9:

          778|       in {
          779|         values = defs''';
             |         ^
          780|         inherit (defs'') highestPrio;

       … while evaluating the attribute 'mergedValue'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:785:5:

          784|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
          785|     mergedValue =
             |     ^
          786|       if isDefined then

       … while evaluating the option `home-manager.users.mon.home.activation.installPackages.data':

       … while evaluating the attribute 'value'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:751:9:

          750|     in warnDeprecation opt //
          751|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          752|         inherit (res.defsFinal') highestPrio;

       … while evaluating anonymous lambda

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:302:72:

          301|           # For definitions that have an associated option
          302|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                                                                        ^
          303|

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/attrsets.nix:401:20:

          400|               then recurse (path ++ [name]) value
          401|               else f (path ++ [name]) value;
             |                    ^
          402|         in mapAttrs g;

       … while evaluating 'g'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/attrsets.nix:398:19:

          397|           g =
          398|             name: value:
             |                   ^
          399|             if isAttrs value && cond value

       … from call site

       … while evaluating the attribute 'data'

       at /nix/store/gby2davr5n2hsxf1rfl6gaf8i17m71ff-source/modules/lib/dag.nix:83:9:

           82|         name = n;
           83|         data = v.data;
             |         ^
           84|         after = v.after ++ dagBefore dag n;

       … while evaluating the attribute 'data'

       at /nix/store/gby2davr5n2hsxf1rfl6gaf8i17m71ff-source/modules/lib/dag.nix:89:37:

           88|     in if sorted ? result then {
           89|       result = map (v: { inherit (v) name data; }) sorted.result;
             |                                     ^
           90|     } else

       … while evaluating 'mkCmd'

       at /nix/store/gby2davr5n2hsxf1rfl6gaf8i17m71ff-source/modules/home-environment.nix:638:17:

          637|       let
          638|         mkCmd = res: ''
             |                 ^
          639|             _iNote "Activating %s" "${res.name}"

       … from call site

       … while evaluating the attribute 'text' of the derivation 'activation-script'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/pkgs/stdenv/generic/make-derivation.nix:270:7:

          269|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          270|       name =
             |       ^
          271|         let

       … while evaluating the attribute 'buildCommand' of the derivation 'home-manager-generation'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/pkgs/stdenv/generic/make-derivation.nix:270:7:

          269|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          270|       name =
             |       ^
          271|         let

       … while evaluating the attribute 'value'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/types.nix:442:60:

          441|           # Push down position info.
          442|           (map (def: mapAttrs (n: v: { inherit (def) file; value = v; }) def.value) defs)));
             |                                                            ^
          443|       emptyValue = { value = {}; };

       … while evaluating 'dischargeProperties'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:837:25:

          836|   */
          837|   dischargeProperties = def:
             |                         ^
          838|     if def._type or "" == "merge" then

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:766:137:

          765|         defs' = concatMap (m:
          766|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
             |                                                                                                                                         ^
          767|         ) defs;

       … while evaluating definitions from `/nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/flake.nix':

       … while evaluating anonymous lambda

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:765:28:

          764|         # Process mkMerge and mkIf properties.
          765|         defs' = concatMap (m:
             |                            ^
          766|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:765:17:

          764|         # Process mkMerge and mkIf properties.
          765|         defs' = concatMap (m:
             |                 ^
          766|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … while evaluating the attribute 'values'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:878:7:

          877|     in {
          878|       values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
             |       ^
          879|       inherit highestPrio;

       … while evaluating the attribute 'values'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:779:9:

          778|       in {
          779|         values = defs''';
             |         ^
          780|         inherit (defs'') highestPrio;

       … while evaluating the attribute 'optionalValue'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:797:5:

          796|
          797|     optionalValue =
             |     ^
          798|       if isDefined then { value = mergedValue; }

       … while evaluating anonymous lambda

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/types.nix:438:86:

          437|       merge = loc: defs:
          438|         mapAttrs (n: v: v.value) (filterAttrs (n: v: v ? value) (zipAttrsWith (name: defs:
             |                                                                                      ^
          439|             (mergeDefinitions (loc ++ [name]) elemType defs).optionalValue

       … from call site

       … while evaluating anonymous lambda

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/types.nix:438:51:

          437|       merge = loc: defs:
          438|         mapAttrs (n: v: v.value) (filterAttrs (n: v: v ? value) (zipAttrsWith (name: defs:
             |                                                   ^
          439|             (mergeDefinitions (loc ++ [name]) elemType defs).optionalValue

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/attrsets.nix:225:62:

          224|   filterAttrs = pred: set:
          225|     listToAttrs (concatMap (name: let v = set.${name}; in if pred name v then [(nameValuePair name v)] else []) (attrNames set));
             |                                                              ^
          226|

       … while evaluating anonymous lambda

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/attrsets.nix:225:29:

          224|   filterAttrs = pred: set:
          225|     listToAttrs (concatMap (name: let v = set.${name}; in if pred name v then [(nameValuePair name v)] else []) (attrNames set));
             |                             ^
          226|

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/attrsets.nix:225:18:

          224|   filterAttrs = pred: set:
          225|     listToAttrs (concatMap (name: let v = set.${name}; in if pred name v then [(nameValuePair name v)] else []) (attrNames set));
             |                  ^
          226|

       … while evaluating 'filterAttrs'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/attrsets.nix:224:23:

          223|   */
          224|   filterAttrs = pred: set:
             |                       ^
          225|     listToAttrs (concatMap (name: let v = set.${name}; in if pred name v then [(nameValuePair name v)] else []) (attrNames set));

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/types.nix:438:35:

          437|       merge = loc: defs:
          438|         mapAttrs (n: v: v.value) (filterAttrs (n: v: v ? value) (zipAttrsWith (name: defs:
             |                                   ^
          439|             (mergeDefinitions (loc ++ [name]) elemType defs).optionalValue

       … while evaluating 'merge'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/types.nix:437:20:

          436|       check = isAttrs;
          437|       merge = loc: defs:
             |                    ^
          438|         mapAttrs (n: v: v.value) (filterAttrs (n: v: v ? value) (zipAttrsWith (name: defs:

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:787:59:

          786|       if isDefined then
          787|         if all (def: type.check def.value) defsFinal then type.merge loc defsFinal
             |                                                           ^
          788|         else let allInvalid = filter (def: ! type.check def.value) defsFinal;

       … while evaluating the attribute 'mergedValue'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:785:5:

          784|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
          785|     mergedValue =
             |     ^
          786|       if isDefined then

       … while evaluating the option `systemd.services.home-manager-mon.serviceConfig':

       … while evaluating the attribute 'value'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:751:9:

          750|     in warnDeprecation opt //
          751|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          752|         inherit (res.defsFinal') highestPrio;

       … while evaluating anonymous lambda

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:302:72:

          301|           # For definitions that have an associated option
          302|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                                                                        ^
          303|

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/attrsets.nix:401:20:

          400|               then recurse (path ++ [name]) value
          401|               else f (path ++ [name]) value;
             |                    ^
          402|         in mapAttrs g;

       … while evaluating 'g'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/attrsets.nix:398:19:

          397|           g =
          398|             name: value:
             |                   ^
          399|             if isAttrs value && cond value

       … from call site

       … while evaluating 'optional'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/lists.nix:255:20:

          254|   */
          255|   optional = cond: elem: if cond then [elem] else [];
             |                    ^
          256|

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/nixos/modules/system/boot/systemd.nix:424:16:

          423|             concatLists [
          424|               (optional (type == "oneshot" && (restart == "always" || restart == "on-success"))
             |                ^
          425|                 "Service '${name}.service' with 'Type=oneshot' cannot have 'Restart=always' or 'Restart=on-success'"

       … while evaluating anonymous lambda

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/nixos/modules/system/boot/systemd.nix:417:16:

          416|       mapAttrsToList
          417|         (name: service:
             |                ^
          418|           let

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/attrsets.nix:356:16:

          355|   mapAttrsToList = f: attrs:
          356|     map (name: f name attrs.${name}) (attrNames attrs);
             |                ^
          357|

       … while evaluating anonymous lambda

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/attrsets.nix:356:10:

          355|   mapAttrsToList = f: attrs:
          356|     map (name: f name attrs.${name}) (attrNames attrs);
             |          ^
          357|

       … from call site

       … while evaluating the attribute 'value'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:586:44:

          585|       defnsByName' = byName "config" (module: value:
          586|           [{ inherit (module) file; inherit value; }]
             |                                            ^
          587|         ) configs;

       … while evaluating 'dischargeProperties'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:837:25:

          836|   */
          837|   dischargeProperties = def:
             |                         ^
          838|     if def._type or "" == "merge" then

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:766:137:

          765|         defs' = concatMap (m:
          766|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
             |                                                                                                                                         ^
          767|         ) defs;

       … while evaluating definitions from `/nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/nixos/modules/system/boot/systemd.nix':

       … while evaluating anonymous lambda

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:765:28:

          764|         # Process mkMerge and mkIf properties.
          765|         defs' = concatMap (m:
             |                            ^
          766|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:765:17:

          764|         # Process mkMerge and mkIf properties.
          765|         defs' = concatMap (m:
             |                 ^
          766|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … while evaluating the attribute 'values'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:878:7:

          877|     in {
          878|       values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
             |       ^
          879|       inherit highestPrio;

       … while evaluating the attribute 'values'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:779:9:

          778|       in {
          779|         values = defs''';
             |         ^
          780|         inherit (defs'') highestPrio;

       … while evaluating the attribute 'mergedValue'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:785:5:

          784|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
          785|     mergedValue =
             |     ^
          786|       if isDefined then

       … while evaluating the option `warnings':

       … while evaluating the attribute 'value'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:751:9:

          750|     in warnDeprecation opt //
          751|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          752|         inherit (res.defsFinal') highestPrio;

       … while evaluating anonymous lambda

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:302:72:

          301|           # For definitions that have an associated option
          302|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                                                                        ^
          303|

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/attrsets.nix:401:20:

          400|               then recurse (path ++ [name]) value
          401|               else f (path ++ [name]) value;
             |                    ^
          402|         in mapAttrs g;

       … while evaluating 'g'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/attrsets.nix:398:19:

          397|           g =
          398|             name: value:
             |                   ^
          399|             if isAttrs value && cond value

       … from call site

       … while evaluating 'fold''

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/lists.nix:56:15:

           55|       len = length list;
           56|       fold' = n:
             |               ^
           57|         if n == len

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/lists.nix:60:8:

           59|         else op (elemAt list n) (fold' (n + 1));
           60|     in fold' 0;
             |        ^
           61|

       … while evaluating 'foldr'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/lists.nix:53:20:

           52|   */
           53|   foldr = op: nul: list:
             |                    ^
           54|     let

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/trivial.nix:414:33:

          413|
          414|   showWarnings = warnings: res: lib.foldr (w: x: warn w x) res warnings;
             |                                 ^
          415|

       … while evaluating 'showWarnings'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/trivial.nix:414:28:

          413|
          414|   showWarnings = warnings: res: lib.foldr (w: x: warn w x) res warnings;
             |                            ^
          415|

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/nixos/modules/system/activation/top-level.nix:136:10:

          135|     then throw "\nFailed assertions:\n${concatStringsSep "\n" (map (x: "- ${x}") failedAssertions)}"
          136|     else showWarnings config.warnings baseSystem;
             |          ^
          137|

       … while evaluating 'fold''

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/lists.nix:56:15:

           55|       len = length list;
           56|       fold' = n:
             |               ^
           57|         if n == len

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/lists.nix:60:8:

           59|         else op (elemAt list n) (fold' (n + 1));
           60|     in fold' 0;
             |        ^
           61|

       … while evaluating 'foldr'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/lists.nix:53:20:

           52|   */
           53|   foldr = op: nul: list:
             |                    ^
           54|     let

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/nixos/modules/system/activation/top-level.nix:139:12:

          138|   # Replace runtime dependencies
          139|   system = foldr ({ oldDependency, newDependency }: drv:
             |            ^
          140|       pkgs.replaceDependency { inherit oldDependency newDependency drv; }

       … while evaluating the attribute 'value'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:586:44:

          585|       defnsByName' = byName "config" (module: value:
          586|           [{ inherit (module) file; inherit value; }]
             |                                            ^
          587|         ) configs;

       … while evaluating 'dischargeProperties'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:837:25:

          836|   */
          837|   dischargeProperties = def:
             |                         ^
          838|     if def._type or "" == "merge" then

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:766:137:

          765|         defs' = concatMap (m:
          766|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
             |                                                                                                                                         ^
          767|         ) defs;

       … while evaluating definitions from `/nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/nixos/modules/system/activation/top-level.nix':

       … while evaluating anonymous lambda

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:765:28:

          764|         # Process mkMerge and mkIf properties.
          765|         defs' = concatMap (m:
             |                            ^
          766|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:765:17:

          764|         # Process mkMerge and mkIf properties.
          765|         defs' = concatMap (m:
             |                 ^
          766|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … while evaluating the attribute 'values'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:878:7:

          877|     in {
          878|       values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
             |       ^
          879|       inherit highestPrio;

       … while evaluating the attribute 'values'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:779:9:

          778|       in {
          779|         values = defs''';
             |         ^
          780|         inherit (defs'') highestPrio;

       … while evaluating the attribute 'mergedValue'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:785:5:

          784|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
          785|     mergedValue =
             |     ^
          786|       if isDefined then

       … while evaluating the option `system.build.toplevel':

       … while evaluating the attribute 'value'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:751:9:

          750|     in warnDeprecation opt //
          751|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          752|         inherit (res.defsFinal') highestPrio;

       … while evaluating anonymous lambda

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/modules.nix:302:72:

          301|           # For definitions that have an associated option
          302|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                                                                        ^
          303|

       … from call site

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/attrsets.nix:401:20:

          400|               then recurse (path ++ [name]) value
          401|               else f (path ++ [name]) value;
             |                    ^
          402|         in mapAttrs g;

       … while evaluating 'g'

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/attrsets.nix:398:19:

          397|           g =
          398|             name: value:
             |                   ^
          399|             if isAttrs value && cond value

       … from call site

       … while evaluating anonymous lambda

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/lib/attrsets.nix:518:24:

          517|     let f = attrPath:
          518|       zipAttrsWith (n: values:
             |                        ^
          519|         let here = attrPath ++ [n]; in

       … from call site
@thiagokokada
Copy link

Anyways, onto my main problem: I add a module into my Doom folder, at modules/lang/idris2, mainly because Doom Emacs doesn't have an Idris2 module, and I have 2 files there:

This does not work. nix-straight-el naively assumes the package is on emacs-overlay and downloads it from there. And as far I know, emacs-overlay only contains packages from MELPA/ELPA, so it will never download it from GitHub.

See #177.

As a workaround, you may try to add idris-community/idris2-mode in our flake.nix and overrides.nix files and this may work. If this works feel free to submit a PR.

If you want only to do it yourself, try emacsPackagesOverlay parameter instead.

@thiagokokada
Copy link

And yeah, the documentation is bad. Both me and @ckiee are fault of it, because we are kinda of advanced Nix users and I think for both of us the documentation is enough (specially the source code documentation). PRs are welcome to improve it too.

@ribosomerocker
Copy link
Author

I already tried using emacsPackagesOverlay, I'm not quite sure how I'd add a package from a Git repository, since I didnt see anything in the documentation.

And about that, I'll be very happy to PR some improvements to the documentation once I get this working. If I have some free time, I'll also frequently make issues whenever this breaks to bulletproof it further, since this project seems to be infamous to just not work :(. Anything to get declarative configuration usable in more places.

@thiagokokada
Copy link

thiagokokada commented Sep 1, 2022

I already tried using emacsPackagesOverlay, I'm not quite sure how I'd add a package from a Git repository, since I didnt see anything in the documentation.

Try something like this (doing by memory, maybe wrong):

{ pkgs, ... }:
{
  emacsPackagesOverlay = self: super: {
     package = super.melpaBuild {
       pname = "package";
       version = "0.0.0";
       src = pkgs.fetchFromGitHub { /* ... */ };
       /* more things here if necessary */
     };
  };
}

@ckiee
Copy link
Member

ckiee commented Sep 1, 2022

I already tried using emacsPackagesOverlay, I'm not quite sure how I'd add a package from a Git repository, since I didnt see anything in the documentation.

See #212 for a similar case. Also, the source of this is we just extract the package names from Emacs/doom/straight and not any of the URL/version metadata. I've tried fixing that before but have gotten lost in piles of lisp, obscure store paths and weird nix code.

And about that, I'll be very happy to PR some improvements to the documentation once I get this working. If I have some free time, I'll also frequently make issues whenever this breaks to bulletproof it further, since this project seems to be infamous to just not work :(. Anything to get declarative configuration usable in more places.

I've found it's hard to modify English in place so feel free to change the phrasing if you aren't sure how to add something otherwise. But, yes, docs are very welcome.

@ribosomerocker
Copy link
Author

Wow, I just came across a disturbing amount of problems trying to use trivialBuild. I tried putting:

    programs.doom-emacs = {
      enable = true;
      doomPrivateDir = ./doom;
      emacsPackage = pkgs.emacsPgtkNativeComp;
      emacsPackagesOverlay = self: super: {
        idris2-mode = self.trivialBuild {
          pname = "idris2-mode";
          ename = "idris2-mode";
          version = "0.0.0";
          src = pkgs.fetchFromGitHub {
            owner = "idris-community";
            repo = "idris2-mode";
            rev = "4a3f9cdb1a155da59824e39f0ac78ccf72f2ca97";
            sha256 = "";
          };
        };
      };
    };

(yes, I know the sha256 is empty, but that's just to get nix to tell me the hash I need to put there, and it doesn't error about that)

in my home-manager configuration, but for whatever reason that errors with:
error: a 'aarch64-darwin' with features {} is required to build '/nix/store/a5dhhm5nhn936q5177nlv3fn3b4jvqly-source.drv', but I am a 'x86_64-linux' with features {benchmark, big-parallel, kvm, nixos-test}

so I tried to comment that all out, but then I get this:

error: attribute 'overrideAttrs' missing

       at /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source/pkgs/top-level/emacs-packages.nix:75:13:

           74|     # Propagate overriden scope
           75|     emacs = emacs'.overrideAttrs(old: {
             |             ^
           76|       passthru = (old.passthru or {}) // {
(use '--show-trace' to show detailed location information)

(though, I did use programs.emacs.package = inputs.nix-doom-emacs; in home-manager)
@ckiee @thiagokokada

@thiagokokada
Copy link

error: a 'aarch64-darwin' with features {} is required to build '/nix/store/a5dhhm5nhn936q5177nlv3fn3b4jvqly-source.drv', but I am a 'x86_64-linux' with features {benchmark, big-parallel, kvm, nixos-test}

Unless you're using the wrong arch by mistake, this looks cursed.

This definitively looks more like a support request now than a bug. I think this is one more point in favor for #252.

@ribosomerocker
Copy link
Author

ribosomerocker commented Sep 1, 2022

I am not on the wrong arch by mistake.

Yeah, I tried asking in the matrix "Nix Emacs" channel but no one used nix-doom-emacs here. That, and the docs situation, plus how the errors I get from nix-doom-emacs are unique to it, this just forced me to create an issue, at least if I want to use doom emacs declaratively.

Nevertheless, I didn't reallly file this as a bug, I definitely knew it was something else.

@ribosomerocker
Copy link
Author

ribosomerocker commented Sep 1, 2022

And what I think it is, is that this is a (no offense, again) very.. uh, monkeypatched project; meaning that it's flimsy and seems to be very easy to break from what I've seen. It might be due for a rewrite if possible, I mean I've known and attempted to use nix-doom-emacs for about 7 months by now, never have I succeeded. And I have met tens of people who also tried this project and also didn't get it working... What do you think? I mean, I don't really remember coming upon a person who has gotten it working at this point I think, though I don't think that it's impossible; just that this is very rare to even function on most systems.

I doubt I'm experienced enough, though I'd also love to help with any issue or rewrite if possible, it's just I was delaying that to if I could get this working to get a feel of how the project works.

@thiagokokada
Copy link

thiagokokada commented Sep 1, 2022

What is the best thing I can recommend you is try posting a minimal example to reproduce your issue using Flakes, and I can try to help.

And what I think it is, is that this is a (no offense, again) very.. uh, monkeypatched project; meaning that it's flimsy and seems to be very easy to break from what I've seen.

Yeah, it is kinda of a project that depends on many different variables. Definitively not ideal, and me and ckie are basically maintaining it for our own usage.

Maybe I should just put a warning in README "here be dragons" or something, because it is definitively not a project that is to be used unless you have deeply knowledge on Nix/Emacs and are also kinda of comfortable to fix issues in the code yourself.

@ckiee
Copy link
Member

ckiee commented Sep 1, 2022

And what I think it is, is that this is a (no offense, again) very.. uh, monkeypatched project; meaning that it's flimsy and seems to be very easy to break from what I've seen. It might be due for a rewrite if possible, I mean I've known and attempted to use nix-doom-emacs for about 7 months by now, never have I succeeded. And I have met tens of people who also tried this project and also didn't get it working... What do you think? I mean, I don't really remember coming upon a person who has gotten it working at this point I think, though I don't think that it's impossible; just that this is very rare to even function on most systems.

I'm surprised it's been that flimsy for you, like I use it every day and there's the CI running with the update cronjobs and all of that.

I guess looking at my wrapper module it does have some stuff that could be covered in NDE itself. #69, #60 and another issue# I don't remember. (..if it exists)

I doubt I'm experienced enough, though I'd also love to help with any issue or rewrite if possible, it's just I was delaying that to if I could get this working to get a feel of how the project works.

I think both of us have a fair bit of knowledge about the internals but they're quite suboptimal and don't feel worthy of the effort needed to write it down, at least for me.

A dive into the lisp/nix/straight hell again would be useful but packages haven't been changing a lot recently so it hasn't been biting me enough to do anything beyond talk about it.

(Also, as I just wrote in #252, the matrix room exists now.)

@thiagokokada
Copy link

thiagokokada commented Sep 1, 2022

So to fix the aarch64-darwin issue, applying this patch to your config should work:

diff --git a/home.nix b/home.nix
index 09ad206..3ba2b78 100644
--- a/home.nix
+++ b/home.nix
@@ -215,7 +215,7 @@
 
     emacs = {
       enable        = true;
-      package       = inputs.nix-doom-emacs;
+      #package       = inputs.nix-doom-emacs;
       #package       = pkgs.emacsPgtkNativeComp;
       extraPackages = epkgs: [ epkgs.vterm ];
     };

This is still not sufficient to build (idris2 still fails to build), but at least you will get a proper error.

BTW, there is no need to set emacs.package, because the NDE module does it to you: https://github.com/nix-community/nix-doom-emacs/blob/master/modules/home-manager.nix#L101

@ribosomerocker
Copy link
Author

I fixed it! other than the above diff, I had to do:

programs = {
    emacs = {
      enable        = true;
      #extraPackages = epkgs: [ epkgs.vterm ];
    };

    doom-emacs = {
      enable = true;
      doomPrivateDir = ./doom;
      emacsPackage = pkgs.emacsPgtkNativeComp;
      emacsPackagesOverlay = self: super: {
        idris2-mode = self.trivialBuild {
          pname = "idris2-mode";
          ename = "idris2-mode";
          version = "0.0.0";
	  buildInputs = [ self.prop-menu ];
          src = pkgs.fetchFromGitHub {
            owner = "idris-community";
            repo = "idris2-mode";
            rev = "4a3f9cdb1a155da59824e39f0ac78ccf72f2ca97";
            sha256 = "sha256-TxsGaG2fBRWWP9aas59kiNnUVD4ZdNlwwaFbM4+n81c=";
          };
        };
      };
};

services.emacs = {
      enable        = true;
      defaultEditor = true;
};

@sepiabrown
Copy link

I fixed it! other than the above diff, I had to do:

programs = {
    emacs = {
      enable        = true;
      #extraPackages = epkgs: [ epkgs.vterm ];
    };

    doom-emacs = {
      enable = true;
      doomPrivateDir = ./doom;
      emacsPackage = pkgs.emacsPgtkNativeComp;
      emacsPackagesOverlay = self: super: {
        idris2-mode = self.trivialBuild {
          pname = "idris2-mode";
          ename = "idris2-mode";
          version = "0.0.0";
	  buildInputs = [ self.prop-menu ];
          src = pkgs.fetchFromGitHub {
            owner = "idris-community";
            repo = "idris2-mode";
            rev = "4a3f9cdb1a155da59824e39f0ac78ccf72f2ca97";
            sha256 = "sha256-TxsGaG2fBRWWP9aas59kiNnUVD4ZdNlwwaFbM4+n81c=";
          };
        };
      };
};

services.emacs = {
      enable        = true;
      defaultEditor = true;
};

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants