I am adding some locally produced packages to the set of packages available in nix. I have written a default.nix file that has the new packages, one is called “uts”. I write a shell.nix file like this:
{ pkgs ? import (fetchGit { url = “git@gitlab.eng.vmware.com:vdm/nixpkgs.git”; ref = “main”; })
}:
pkgs.mkShell {
buildInputs = [
pkgs.nodejs_18
pkgs.yarn
pkgs.bazelisk
pkgs.bazel_5
pkgs.which
pkgs.docker
pkgs.python39
pkgs.git
pkgs.darwin.sigtool
pkgs.uts
];
}
This works great to get the uts package - it is found no problem. However when I use:
nix-shell -p uts
From the same directory it fails to find the uts derivation, it is not using the import from my shell.nix file:
error: undefined variable 'uts'
at «string»:1:107:
1| {...}@args: with import <nixpkgs> args; (pkgs.runCommandCC or pkgs.runCommand) "shell" { buildInputs = [ (uts) ]; } ""
How can I fix this problem?