As title says. A nix-shell for the following derivation will have its affinity set to a single core:
with import <nixpkgs> {};
stdenv.mkDerivation
{
src = lib.cleanSourceWith
{
src = ./.;
filter = _: _: builtins.hasAttr "bar" (builtins.readDir hello);
};
name = "foo";
}
$ nix-shell --run nproc
1
There's probably a restoreAffinity() missing somewhere.