cmacrae / emacs

Nightly custom Emacs builds for macOS Nix environments
MIT License
42 stars 17 forks source link

Bump maximum allowed macOS version #1

Closed scotttrinh closed 3 years ago

scotttrinh commented 3 years ago

(Sorry for the empty description here, opened PR from the Github VSCode thing)

Trying to get this working on my new M1 laptop that has macOS 11.5.2, and while trying to debug the error I'm seeing I noticed this line. Not sure if it actually fixes my issue yet, but thought I'd fork and open a PR anyway. Will report back if it makes any difference!

montchr commented 3 years ago

FWIW, I've been running this on macOS 11.6 without issue, and was running it on the most recent version of 11.5 before that.

scotttrinh commented 3 years ago

Was not required at all. For some reason, having the emacs-overlay at the same time was the issue. Adding it produces this error:

error: 'builtins.storePath' is not allowed in pure evaluation mode

       at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/attrsets.nix:335:15:

          334|     let
          335|       path' = builtins.storePath path;
             |               ^
          336|       res =
(use '--show-trace' to show detailed location information)

With the trace:

With the trace ``` error: 'builtins.storePath' is not allowed in pure evaluation mode at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/attrsets.nix:335:15: 334| let 335| path' = builtins.storePath path; | ^ 336| res = … while evaluating the attribute 'passAsFile' at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-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-fonts' at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/pkgs/stdenv/generic/make-derivation.nix:207:7: 206| let 207| # Indicate the host platform of the derivation if cross compiling. | ^ 208| # Fixed-output derivations like source tarballs shouldn't get a host … while evaluating the attribute 'value' at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/modules.nix:392:44: 391| defnsByName' = byName "config" (module: value: 392| [{ inherit (module) file; inherit value; }] | ^ 393| ) configs; … while evaluating 'dischargeProperties' at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/modules.nix:609:25: 608| */ 609| dischargeProperties = def: | ^ 610| if def._type or "" == "merge" then … from call site at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/modules.nix:538:137: 537| defs' = concatMap (m: 538| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value)) | ^ 539| ) defs; … while evaluating definitions from `/nix/store/qw8igmbp09dz45k7a1b4w2ynz1gr2p6y-source/modules/targets/darwin/fonts.nix': … while evaluating anonymous lambda at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/modules.nix:537:28: 536| # Process mkMerge and mkIf properties. 537| defs' = concatMap (m: | ^ 538| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value)) … from call site at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/modules.nix:537:17: 536| # Process mkMerge and mkIf properties. 537| defs' = concatMap (m: | ^ 538| 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/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/modules.nix:650:7: 649| in { 650| values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs; | ^ 651| inherit highestPrio; … while evaluating the attribute 'values' at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/modules.nix:551:9: 550| in { 551| values = defs'''; | ^ 552| inherit (defs'') highestPrio; … while evaluating the attribute 'mergedValue' at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/modules.nix:557:5: 556| # Type-check the remaining definitions, and merge them. Or throw if no definitions. 557| mergedValue = | ^ 558| if isDefined then … while evaluating the option `home-manager.users.scotttrinh.home.activation.copyFonts.data': … while evaluating the attribute 'value' at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/modules.nix:525:9: 524| in warnDeprecation opt // 525| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value; | ^ 526| inherit (res.defsFinal') highestPrio; … while evaluating anonymous lambda at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/modules.nix:140:72: 139| # For definitions that have an associated option 140| declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options; | ^ 141| … from call site at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/attrsets.nix:304:20: 303| then recurse (path ++ [name]) value 304| else f (path ++ [name]) value; | ^ 305| in mapAttrs g set; … while evaluating 'g' at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/attrsets.nix:301:19: 300| g = 301| name: value: | ^ 302| if isAttrs value && cond value … from call site … while evaluating the attribute 'data' at /nix/store/qw8igmbp09dz45k7a1b4w2ynz1gr2p6y-source/modules/lib/dag.nix:85:9: 84| name = n; 85| data = v.data; | ^ 86| after = v.after ++ dagBefore dag n; … while evaluating the attribute 'data' at /nix/store/qw8igmbp09dz45k7a1b4w2ynz1gr2p6y-source/modules/lib/dag.nix:91:37: 90| in if sorted ? result then { 91| result = map (v: { inherit (v) name data; }) sorted.result; | ^ 92| } else … while evaluating 'mkCmd' at /nix/store/qw8igmbp09dz45k7a1b4w2ynz1gr2p6y-source/modules/home-environment.nix:559:17: 558| let 559| mkCmd = res: '' | ^ 560| noteEcho Activating ${res.name} … from call site … while evaluating the attribute 'text' of the derivation 'activation-script' at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/pkgs/stdenv/generic/make-derivation.nix:207:7: 206| let 207| # Indicate the host platform of the derivation if cross compiling. | ^ 208| # Fixed-output derivations like source tarballs shouldn't get a host … while evaluating the attribute 'buildCommand' of the derivation 'home-manager-generation' at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/pkgs/stdenv/generic/make-derivation.nix:207:7: 206| let 207| # Indicate the host platform of the derivation if cross compiling. | ^ 208| # Fixed-output derivations like source tarballs shouldn't get a host … while evaluating the attribute 'text' of the derivation 'activation-scotttrinh' at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/pkgs/stdenv/generic/make-derivation.nix:207:7: 206| let 207| # Indicate the host platform of the derivation if cross compiling. | ^ 208| # Fixed-output derivations like source tarballs shouldn't get a host … while evaluating anonymous lambda at /nix/store/qw8igmbp09dz45k7a1b4w2ynz1gr2p6y-source/nix-darwin/default.nix:125:56: 124| system.activationScripts.postActivation.text = 125| concatStringsSep "\n" (mapAttrsToList (username: usercfg: '' | ^ 126| echo Activating home-manager configuration for ${username} … from call site at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/attrsets.nix:259:16: 258| mapAttrsToList = f: attrs: 259| map (name: f name attrs.${name}) (attrNames attrs); | ^ 260| … while evaluating anonymous lambda at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/attrsets.nix:259:10: 258| mapAttrsToList = f: attrs: 259| map (name: f name attrs.${name}) (attrNames attrs); | ^ 260| … from call site … while evaluating the attribute 'value' at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/modules.nix:392:44: 391| defnsByName' = byName "config" (module: value: 392| [{ inherit (module) file; inherit value; }] | ^ 393| ) configs; … while evaluating 'dischargeProperties' at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/modules.nix:609:25: 608| */ 609| dischargeProperties = def: | ^ 610| if def._type or "" == "merge" then … from call site at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/modules.nix:538:137: 537| defs' = concatMap (m: 538| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value)) | ^ 539| ) defs; … while evaluating definitions from `': … while evaluating anonymous lambda at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/modules.nix:537:28: 536| # Process mkMerge and mkIf properties. 537| defs' = concatMap (m: | ^ 538| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value)) … from call site at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/modules.nix:537:17: 536| # Process mkMerge and mkIf properties. 537| defs' = concatMap (m: | ^ 538| 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/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/modules.nix:650:7: 649| in { 650| values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs; | ^ 651| inherit highestPrio; … while evaluating the attribute 'values' at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/modules.nix:551:9: 550| in { 551| values = defs'''; | ^ 552| inherit (defs'') highestPrio; … while evaluating the attribute 'mergedValue' at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/modules.nix:557:5: 556| # Type-check the remaining definitions, and merge them. Or throw if no definitions. 557| mergedValue = | ^ 558| if isDefined then … while evaluating the option `system.activationScripts.postActivation.text': … while evaluating the attribute 'value' at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/modules.nix:525:9: 524| in warnDeprecation opt // 525| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value; | ^ 526| inherit (res.defsFinal') highestPrio; … while evaluating anonymous lambda at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/modules.nix:140:72: 139| # For definitions that have an associated option 140| declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options; | ^ 141| … from call site at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/attrsets.nix:304:20: 303| then recurse (path ++ [name]) value 304| else f (path ++ [name]) value; | ^ 305| in mapAttrs g set; … while evaluating 'g' at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/attrsets.nix:301:19: 300| g = 301| name: value: | ^ 302| if isAttrs value && cond value … from call site … while evaluating the attribute 'value' at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/modules.nix:392:44: 391| defnsByName' = byName "config" (module: value: 392| [{ inherit (module) file; inherit value; }] | ^ 393| ) configs; … while evaluating 'dischargeProperties' at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/modules.nix:609:25: 608| */ 609| dischargeProperties = def: | ^ 610| if def._type or "" == "merge" then … from call site at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/modules.nix:538:137: 537| defs' = concatMap (m: 538| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value)) | ^ 539| ) defs; … while evaluating definitions from `/nix/store/nb2kapr1yf12ra2x3jmdbm2lwfh9c1pr-source/modules/system/activation-scripts.nix': … while evaluating anonymous lambda at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/modules.nix:537:28: 536| # Process mkMerge and mkIf properties. 537| defs' = concatMap (m: | ^ 538| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value)) … from call site at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/modules.nix:537:17: 536| # Process mkMerge and mkIf properties. 537| defs' = concatMap (m: | ^ 538| 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/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/modules.nix:650:7: 649| in { 650| values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs; | ^ 651| inherit highestPrio; … while evaluating the attribute 'values' at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/modules.nix:551:9: 550| in { 551| values = defs'''; | ^ 552| inherit (defs'') highestPrio; … while evaluating the attribute 'mergedValue' at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/modules.nix:557:5: 556| # Type-check the remaining definitions, and merge them. Or throw if no definitions. 557| mergedValue = | ^ 558| if isDefined then … while evaluating the option `system.activationScripts.script.text': … while evaluating the attribute 'value' at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/modules.nix:525:9: 524| in warnDeprecation opt // 525| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value; | ^ 526| inherit (res.defsFinal') highestPrio; … while evaluating anonymous lambda at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/modules.nix:140:72: 139| # For definitions that have an associated option 140| declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options; | ^ 141| … from call site at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/attrsets.nix:304:20: 303| then recurse (path ++ [name]) value 304| else f (path ++ [name]) value; | ^ 305| in mapAttrs g set; … while evaluating 'g' at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/lib/attrsets.nix:301:19: 300| g = 301| name: value: | ^ 302| if isAttrs value && cond value … from call site … while evaluating the attribute 'activationScript' of the derivation 'darwin-system-21.11.20210916.cbb9567+darwin4.007d700' at /nix/store/p6cjkwimwlkd4nyfckmx884gh0vnksas-source/pkgs/stdenv/generic/make-derivation.nix:207:7: 206| let 207| # Indicate the host platform of the derivation if cross compiling. | ^ 208| # Fixed-output derivations like source tarballs shouldn't get a host ```
cmacrae commented 3 years ago

Hey @scotttrinh 👋🏻 Thanks for raising this and thanks @montchr for chiming in here.

I'm really glad to see some others using this flake :)

So, as you've found out, it should build and run fine, as far as I'm concerned. I don't have an M1 machine to test on, however.

That said, regarding your last comment, I use this flake in conjunction with the emacs-overlay (assuming you're talking about the nix-community one?). What does your config look like?

All you should need to do is ensure you're setting the pkg parameter appropriately for whichever function you're using from emacs-overlay. For example, in my config I'm using the emacsWithPackagesFromUsePackage function, so I set package = pkgs.emacs; because this flake overlays to that package. Take here, for instance, setting home-manager's programs.emacs.package to use the emacs-overlay and the overlay from this flake:

    programs.emacs.package = pkgs.emacsWithPackagesFromUsePackage {
            alwaysEnsure = true;
            alwaysTangle = true;

            # Custom overlay derived from 'emacs' flake input
            package = pkgs.emacs;
scotttrinh commented 3 years ago

@cmacrae

Thanks for the detailed answer. I'm still trying to wrap my head around how nix works, and that really helped connect some dots for me! I've had a hard time looking at complex multi-file configs like yours (and @montchr) and really understand what's happening, so having this extra bit of explanation is super helpful. 🙏

cmacrae commented 3 years ago

Sure @scotttrinh :) No problem, glad to hear it's working 👍 Don't hesitate to reach out if you want/need any more help, or even in general, feel free to e-mail or Discord (cmacrae#6392) me if you want to chat about Nix