muoscar
September 22, 2025, 8:51am
1
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
TLATER
September 22, 2025, 10:40am
2
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.
muoscar:
nativeBuildInputs
Use packages for mkShell.
muoscar
September 22, 2025, 12:10pm
3
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
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:
opened 03:38PM - 06 Dec 23 UTC
bug
**Describe the bug**
When I start a nix-shell with a single-output package, `β¦ man <whatever>` will give me a man page from that package. When I start a nix-shell with a multiple-output package, `man <whatever>` will tell me βNo manual entry for <whatever>β.
**Steps To Reproduce**
1. Run
```bash
nix-shell --pure --packages man less hello --run "man hello"
```
That command will work because `hello` only has one output.
2. Run
```bash
nix-shell --pure --packages man less bash.man --run "man bash"
```
That command wonβt work because `bash` has more than one output.
**Expected behavior**
`man <whatever>` should work regardless of whether or not the package has multiple outputs. As long as the user told nix-shell to use an output that contain man pages, they should be added to `man`βs search path.
**`nix-env --version` output**
nix-env (Nix) 2.18.1
**Additional context**
I made a script that works around the problem:
```bash
#!/usr/bin/env nix-shell
#! nix-shell -i bash -p jq
# π
π1.0 This file is dedicated to the public domain using the CC0 1.0 Universal
# Public Domain Dedication <https://creativecommons.org/publicdomain/zero/1.0/>.
set -e
function generate_manpath
{
for attribute_name in "$@"
do
# Thanks, tobiasBora, olmokramer and cole-h:
# β’ <https://discourse.nixos.org/t/eval-nix-expression-from-the-command-line/8993/5?u=jasonyundt>
# β’ <https://discourse.nixos.org/t/eval-nix-expression-from-the-command-line/8993/6?u=jasonyundt>
# β’ <https://discourse.nixos.org/t/eval-nix-expression-from-the-command-line/8993/8?u=jasonyundt>
nix-instantiate --eval -E "\"\${(import <nixpkgs> {}).$attribute_name}/share/man\"" | jq --join-output
echo -n :
done
}
MANPATH="$(generate_manpath "$@")" nix-shell --packages "$@"
```
Save it as `shell-with-man-pages.sh`, and then run something like this:
```bash
./shell-with-man-pages.sh subversionClient subversionClient.man
```
**Priorities**
Add :+1: to [issues you find important](https://github.com/NixOS/nix/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc).
They mention a workaround that I personally also find clunky.
1 Like