NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.4k stars 14.35k forks source link

Cannot install gnomeExtensions package attribute is missing #332110

Closed starr-dusT closed 4 months ago

starr-dusT commented 4 months ago

Describe the bug

I'm trying to install gnomeExtensions on flake-based nixos-unstable configuration (updated 2-3 weeks ago). Every extension fails to install indicating that the package attribute is missing.

For example the config:

  environment.systemPackages = with pkgs; [
      gnomeExtensions.ping
  ];

results in:

error:
       … while calling the 'head' builtin

         at /nix/store/dk2rpyb6ndvfbf19bkb2plcz5y3k8i5v-source/lib/attrsets.nix:1575:11:

         1574|         || pred here (elemAt values 1) (head values) then
         1575|           head values
             |           ^
         1576|         else

       … while evaluating the attribute 'value'

         at /nix/store/dk2rpyb6ndvfbf19bkb2plcz5y3k8i5v-source/lib/modules.nix:809:9:

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

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: attribute 'ping' missing

       at /nix/store/4g0chsq2fkcyzcqix817qkkxmias8wfi-source/provision/hosts/kestrel/configuration.nix:30:7:

           29|       distrobox # Platform for creating and managing Linux distribution images.
           30|       gnomeExtensions.ping
             |       ^
           31|   ];

Not sure why the packages are unavailable since I can see them on the unstable nixpkgs search, can pull them down with nix-shell -p, and can see the extensions are package per the extensions.json on the nixpkgs github.

Expected behavior

Should be able to install gnomeExtensions available within nixpkgs

Notify maintainers

@Mic92 @jtojnar

Metadata

$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.9.7-zen1, NixOS, 24.11 (Vicuna), 24.11.20240703.9f4128e`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.4`
 - channels(tstarr): `""`
 - nixpkgs: `/nix/store/dk2rpyb6ndvfbf19bkb2plcz5y3k8i5v-source`

Add a :+1: [reaction] to [issues you find important].

eclairevoyant commented 4 months ago

update your flake input and try again. or share your config with this line added

starr-dusT commented 4 months ago

Thanks for the response @eclairevoyant!

Turns out it had to do with another overlay that was breaking my gnomeExtensions for some reason.

I initially had:

self: super: {
  gnomeExtensions.focus-changer = super.gnomeExtensions.focus-changer.overrideAttrs (old: {
   src = super.fetchFromGitHub {
      owner = "martinhjartmyr";
      repo = "gnome-shell-extension-focus-changer";
      rev = "...";
      sha256 = "...";
    };
  });
}

changing that to this fixed the issue:

self: super: {
  gnomeExtensions = super.gnomeExtensions // {
    focus-changer = super.gnomeExtensions.focus-changer.overrideAttrs (old: { 
      src = super.fetchFromGitHub { 
        owner = "martinhjartmyr"; 
        repo = "gnome-shell-extension-focus-changer"; 
        rev = "..."; 
        sha256 = "...";
      }; 
    }); 
  };
}

My nix-fu isn't the best so not exactly sure why the initial overlay was a problem, but thought I'd leave this here in case someone else manages to do the same thing.

jtojnar commented 4 months ago
{
  gnomeExtensions.focus-changer = /* … */;
}

is just a syntactic sugar for

{
  gnomeExtensions = {
    focus-changer = /* … */;
  };
}

and overlays perform only non-recursive attribute merge (using // operator).