nix-community / nix-doom-emacs

doom-emacs packaged for Nix [maintainers=@thiagokokada]
MIT License
214 stars 43 forks source link

Build fails with error about libgenerated.nix #424

Closed strobe closed 1 year ago

strobe commented 1 year ago

tried to build my usual config today (nothing changed for few weeks, and last time were no issues)

and got this error:

error: attribute 'codeberg' missing for call to 'getAttr'

       at /nix/store/aaghjswwb05hlbc5dgxvka0swdcib0g7-nixos/nixos/pkgs/applications/editors/emacs/elisp-packages/libgenerated.nix:10:33:

            9|                         , commit
           10|                         , ...}: {
             |                                 ^
           11|       github = self.callPackage ({ fetchFromGitHub }:
(use '--show-trace' to show detailed location information)

and looks like 2.11 doesn't has codeberg https://github.com/NixOS/nixpkgs/blob/21.11/pkgs/applications/editors/emacs/elisp-packages/libgenerated.nix

but master has

https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/emacs/elisp-packages/libgenerated.nix#L54

thiagokokada commented 1 year ago

Looks like an error in emacs-overlay, not us.

strobe commented 1 year ago

thanks, reported to emacs-overlay repo and found that it can work with https://github.com/nix-community/emacs-overlay/archive/refs/heads/nativecomp-gcc-attr.tar.gz and probably with master commits before Oct-Sep 22

jeff-hykin commented 1 year ago

@strobe what might using that look like?

I tried it as an overlay and it had no effect on the error for me:

let 
    emacsOverlay = (builtins.import 
        (builtins.fetchTarball
            ({url="https://github.com/nix-community/emacs-overlay/archive/refs/heads/nativecomp-gcc-attr.tar.gz";})
        )
    );
    pkgs = (builtins.import 
        (builtins.fetchTarball
            ({url="https://github.com/NixOS/nixpkgs/archive/ce6aa13369b667ac2542593170993504932eb836.tar.gz";})
        )
        ({
            overlays = [ 
                emacsOverlay
             ]; 
        })
    );
    doomEmacs = (pkgs.callPackage 
        (
            builtins.fetchTarball 
            {
                url = https://github.com/nix-community/nix-doom-emacs/archive/master.tar.gz;
            }
        ) 
        {
            # frozen config
            doomPrivateDir = builtins.fetchTarball ({
                url="https://github.com/ballantony/doom-emacs-config/archive/master.tar.gz";
            });
        }
    );
in
    doomEmacs
strobe commented 1 year ago

@jeff-hykin in my case just 'nix-channel --update' or 'sudo nix-channel --update' fixed issue (as I mention in linked issue on 'emacs-overlay').

Seems I didn't updated for while and something went out of sync at some point.

my configuration looks like this:

      doom-emacs = pkgs.callPackage (builtins.fetchTarball {
        url = "https://github.com/nix-community/nix-doom-emacs/archive/master.tar.gz";
      }) {
        doomPrivateDir = /path/to/.doom.d;  
        # Use the latest emacs-overlay
        dependencyOverrides = {
          "emacs-overlay" = (builtins.fetchTarball {
              url = https://github.com/nix-community/emacs-overlay/archive/master.tar.gz;
          });
        };

        emacsPackagesOverlay = self: super: {
           gitignore-mode = pkgs.emacsPackages.git-modes;
           gitconfig-mode = pkgs.emacsPackages.git-modes;
           gitattributes-mode =  pkgs.emacsPackages.git-modes;
        };
      };
jeff-hykin commented 1 year ago

Thanks for the quick response!

For anyone else reading, in my case that just meant updating the pinned nixpkgs commit in code I posted. This code avoids the error:

let 
    emacsOverlay = (builtins.import 
        (builtins.fetchTarball
            ({url="https://github.com/nix-community/emacs-overlay/archive/refs/heads/nativecomp-gcc-attr.tar.gz";})
        )
    );
    pkgs = (builtins.import 
        (builtins.fetchTarball
            # >>> newer commit used here:
            ({url="https://github.com/NixOS/nixpkgs/archive/a161e8d1dfbd6a81630214e2a767a525cb92abfc.tar.gz";})
        )
        ({
            overlays = [ 
                emacsOverlay
             ]; 
        })
    );
    doomEmacs = (pkgs.callPackage 
        (
            builtins.fetchTarball 
            {
                url = https://github.com/nix-community/nix-doom-emacs/archive/master.tar.gz;
            }
        ) 
        {
            # frozen config
            doomPrivateDir = builtins.fetchTarball ({
                url="https://github.com/ballantony/doom-emacs-config/archive/master.tar.gz";
            });
        }
    );
in
    doomEmacs

now I get a different error 😅