How to use uutils-coreutils instead of the builtin coreutils?

I just installed the uutils-coreutils package but it gives me prefixed binaries like uutils-cp instead of just cp. I’m trying to live on the edge and use uutils-coreutils instead of any built-ins. Is there a way to do this, preferably home-manager-friendly?

It looks like there’s indeed an option for this: https://github.com/NixOS/nixpkgs-channels/blob/c59ea8b8a0e7f927e7291c14ea6cd1bd3a16ff38/pkgs/tools/misc/uutils-coreutils/default.nix#L21. It’s just not clear to me how to adjust prefix from within home-manager. Does anyone know how to do this?

Usually when you want to live on the edge, its best not to ask for a complete solution but mention the steps you’ve taken and where you’re stuck.

When you add the package you need to override the prefix argument. Set it null or whatever you want.

Gotcha, I’m not having much success with .override and .overrideAttrs unfortunately:

home.packages = [
    pkgs.uutils-coreutils.override { prefix = ""; }
];

gives me an error:

❯ home-manager switch             
error: The option value `home.packages.[definition 16-entry 10]' in `/home/skainswo/.config/nixpkgs/home.nix' is not of type `package'.
1 Like

You need brackets:

home.packages = [
    (pkgs.uutils-coreutils.override { prefix = ""; })
];
2 Likes

Awesome, thanks @Ninlives! That did the trick.