I am leaning to use flakes. But the problem I am facing is more general.
I need to set the priority of clang to high because otherwise tools from gcc-wrapper
collide with clang
s tools. So I am wondering how to find out what causes a package to be linked into a development environment.
{
description = "pw-viz flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
nci.url = "github:yusdacra/nix-cargo-integration";
nci.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, nci, ... }:
nci.lib.makeOutputs {
root = ./.;
overrides = {
shell = common: prev: {
packages = prev.packages ++ [
common.pkgs.xorg.libX11
common.pkgs.xorg.libXcursor
common.pkgs.xorg.libXrandr
common.pkgs.xorg.libXi
common.pkgs.xorg.libxcb
common.pkgs.libGL
(common.pkgs.hiPrio common.pkgs.clang)
];
};
crateOverrides = common: prev: {
"libspa-sys" = prev: {
buildInputs = (prev.buildInputs or [ ]) ++ [
common.pkgs.pipewire
common.pkgs.libclang
];
nativeBuildInputs = (prev.nativeBuildInputs or [ ]) ++ [
common.pkgs.pkgconfig
];
};
};
};
};
}
UPDATE: the answer is basically here:
https://nixos.org/guides/nix-pills/automatic-runtime-dependencies.html#automatic-runtime-dependencies
and
https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-why-depends.html