Skip to content

emacs-overlay cause errors #464

@a12l

Description

@a12l

Expected Behavior

When you add inputs.emacs-overlay.url = "github:nix-community/emacs-overlay/e47ffb5d60d8e8271d412945c685dbeac2fca7a4"; to your flake.nix file and rebuild your configuration, Emacs is downloaded and added to your host's /nix/store.

This behavior is demonstrated when you add inputs.emacs-overlay.url = "github:nix-community/emacs-overlay/334ba8c610cf5e41dfe130507030e5587e3551b4"; to your flake.nix file instead and rebuild your configuration. This is the last working commit.

Current Behavior

When you add inputs.emacs-overlay.url = "github:nix-community/emacs-overlay/e47ffb5d60d8e8271d412945c685dbeac2fca7a4"; to your flake.nix file you get the following error when you try to build the configuration

$ nixos-rebuild build --flake .#
building the system configuration...
error: attribute 'optionalAttrs' missing

       at /nix/store/4rkachpqaswh6bkbcvc02sv72i2nsl4a-source/default.nix:180:6:

          179|
          180| } // super.lib.optionalAttrs (super.config.allowAliases or true) {
             |      ^
          181|   emacsGcc = builtins.trace "emacsGcc has been renamed to emacsNativeComp, please update your expression." emacsNativeComp;
(use '--show-trace' to show detailed location information)

And if you try to install Emacs, e.g. by creating a emacs.nix profile with the following lines; adding that profile to one of your suits; and create an empty init.el file in the same directory as the profile

{pkgs, ...}: {
  home.packages = [
    (pkgs.emacsWithPackagesFromUsePackage { config = ./init.el; })
  ];
}

you get this error

$ nixos-rebuild build --flake .#
error: value is null while a set was expected

       at /nix/store/a5kpkzkipwzqpxadnlpxbbkq9zgk4r8a-source/default.nix:180:6:

          179|
          180| } // super.lib.optionalAttrs (super.config.allowAliases or true) {
             |      ^
          181|   emacsGcc = builtins.trace "emacsGcc has been renamed to emacsNativeComp, please update your expression." emacsNativeComp;
(use '--show-trace' to show detailed location information)

Possible Solution

Steps to Reproduce

  1. Add inputs.emacs-overlay.url = "github:nix-community/emacs-overlay/e47ffb5d60d8e8271d412945c685dbeac2fca7a4"; to your flake.nix.

Context

@adisbladis gave this example demonstrating that no bug was introduced with e47ffb5d60d8e8271d412945c685dbeac2fca7a4.

{
  description = "Foo";
  inputs = {
    emacs-overlay.url = "github:nix-community/emacs-overlay/e47ffb5d60d8e8271d412945c685dbeac2fca7a4";
    emacs-overlay.inputs.nixpkgs.follows = "nixpkgs";
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
  };
  outputs = { self, nixpkgs, emacs-overlay }: let
    pkgs = import nixpkgs {
      system = "x86_64-linux";
      overlays = [
        emacs-overlay.overlay
      ];
    };
  in {
    packages.x86_64-linux.default = pkgs.emacs;
  };
}

This downloads and installs Emacs without any errors for me.

Your Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is neededpriority

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions