nix-community / nixpkgs-wayland

Automated, pre-built packages for Wayland (sway/wlroots) tools for NixOS. [maintainers=@colemickens, @Artturin]
510 stars 45 forks source link

Dependency is not of a valid type: element 4 of buildInputs for libxkbcommon #430

Closed JimmJam closed 10 months ago

JimmJam commented 10 months ago

I am attempting to import this Github as an overlay but am having some troubles. First, strangely, overlay.nix doesn't seem to exist in https://github.com/nix-community/nixpkgs-wayland/archive/master.tar.gz, and have instead had to import it using archive/refs/heads/master.zip instead, which seems to provide the same result as directly importing the overlay.nix from a URL.

Currently, this is how I have my overlays formatted (I prefer this to using let as I can remove any of these very quickly if I don't need them):

# Allow unfree packages and accept packages from the Nix User Repos                                             
   nixpkgs = {                                                                                                     
     config = {                                                                                                    
       allowUnfree = true;                                                                                         
       permittedInsecurePackages = [ "electron-24.8.6" ];                                                          
       packageOverrides = pkgs: {                                                                                  
         unstable = import (builtins.fetchTarball                                                                  
           "https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz") {                                     
           inherit pkgs;                                                                                           
           config = { allowUnfree = true; };                                                                       
         };                                                                                                        
         nur = import (builtins.fetchTarball                                                                       
           "https://github.com/nix-community/NUR/archive/master.tar.gz") {                                         
           inherit pkgs;                                                                                           
         };                                                                                                        
         wayland = import "${builtins.fetchTarball                                                                 
           https://github.com/nix-community/nixpkgs-wayland/archive/refs/heads/master.zip}/overlay.nix" {          
           inherit pkgs;                                                                                           
         };                                                                                                        
       };                                                                                                          
     };          

nur and unstable work fine as of right now, but the wayland repo provides me this error when using a nixos-rebuild switch:

building Nix...
building the system configuration...
error:
       … while calling the 'head' builtin

         at /nix/store/6zjbvw6yynp7fj77y1p435d2gchdzv3r-nixos/nixos/lib/attrsets.nix:850:11:

          849|         || pred here (elemAt values 1) (head values) then
          850|           head values
             |           ^
          851|         else

       … while evaluating the attribute 'value'

         at /nix/store/6zjbvw6yynp7fj77y1p435d2gchdzv3r-nixos/nixos/lib/modules.nix:807:9:

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

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

       error: Dependency is not of a valid type: element 4 of buildInputs for libxkbcommon

I haven't seen anything else mentioned with libxkbcommon, so I'm not quite sure why this is happening.

My full NixOS files are here: Configuration.nix - https://pastebin.com/JK4wFyiw Jimbo.nix - https://pastes.io/jzua6lfb5t

Artturin commented 10 months ago

overlay.nix is there for me in master.tar.gz

packageOverrides != overlays https://github.com/nix-community/nixpkgs-wayland#install-for-nixos-non-flakes-manual-import

It's possible that nixpkgs-wayland doesn't work with 23.05 as we only support using nixos-unstable.

JimmJam commented 10 months ago

I'm actually on unstable right now, that was just some experimentation I've been doing to see if release would work for me. I got it imported but it doesn't seem like the build in this repo works with the version of SwayFX I'm trying, but thank you for the help! I'll keep the overlays != overrides lesson in mind from now on :)