Confused about wayland package

I have a devShell where I develop a wayland client. I noticed that the following works.

{
  inputs = {
    utils.url = "github:numtide/flake-utils";
  };
  outputs =
    {self, nixpkgs, utils}:
    utils.lib.eachDefaultSystem (
      system:
      let
        pkgs = nixpkgs.legacyPackages.${system};
      in
      {
        devShells.default = pkgs.clangStdenv.mkDerivation {
          name = "myDevShell";
          nativeBuildInputs = with pkgs; [
            wayland
          ];
        };
      }
    );
}

But I can’t actually find wayland on NixOS Search, how come? How am I meant to discover pkgs.wayland in the first place? How do I inspect its outputs/what is contained in the derivation?

Sorry if this is a naive question :stuck_out_tongue:

The search hides aliases, so some packages are just invisible. Might be the case for this one, I’m a bit too lazy to dig through the aliases files to figure that out for sure.

nix search or nix-env -Q don’t have this issue.

You can always nix build the attribute and look in the result directory.

Use packages for mkShell.

Thanks, this was very helpful!

I built the derivation and notices that one of the result folders contained a bunch of man-pages. These man pages are not available to me in the shell, how could I go about finding out where they end up/why they are not in the path my man command uses? Can I find the source for the wayland derivation somehow?

Here is the result with man-pages:

result-man/
└── share
    └── man
        └── man3
            β”œβ”€β”€ wl_argument.3.gz
            β”œβ”€β”€ wl_array.3.gz
            β”œβ”€β”€ wl_client.3.gz
            β”œβ”€β”€ wl_cursor.3.gz
            β”œβ”€β”€ wl_cursor_image.3.gz
            β”œβ”€β”€ wl_cursor_theme.3.gz
            β”œβ”€β”€ wl_display.3.gz
            β”œβ”€β”€ wl_event_loop.3.gz
            β”œβ”€β”€ wl_event_queue.3.gz
            β”œβ”€β”€ wl_event_source.3.gz
            β”œβ”€β”€ wl_global.3.gz
            β”œβ”€β”€ wl_interface.3.gz
            β”œβ”€β”€ wl_list.3.gz
            β”œβ”€β”€ wl_listener.3.gz
            β”œβ”€β”€ wl_message.3.gz
            β”œβ”€β”€ wl_object.3.gz
            β”œβ”€β”€ wl_protocol_logger.3.gz
            β”œβ”€β”€ wl_protocol_logger_message.3.gz
            β”œβ”€β”€ wl_proxy.3.gz
            β”œβ”€β”€ wl_resource.3.gz
            β”œβ”€β”€ wl_resource_iterator_context.3.gz
            β”œβ”€β”€ wl_shm_buffer.3.gz
            β”œβ”€β”€ wl_shm_pool.3.gz
            β”œβ”€β”€ wl_shm_sigbus_data.3.gz
            β”œβ”€β”€ wl_signal.3.gz
            └── wl_socket.3.gz

As for using packages, I was using pkgs.clangStdenv.mkDerivation which didn’t seem to use the packages attribute. But I did switch to

        devShells.default = (pkgs.mkShell.override { stdenv = pkgs.clangStdenv; }) {
          packages = with pkgs; [ wayland ];
        };

and that worked nicely, thanks :slight_smile:

You can use nix shell nixpkgs#wayland and the manpages are available in the shell (but I do recognize how clunky that is).

This seems to be a longstanding nix issue:

They mention a workaround that I personally also find clunky.

1 Like