Skip to content

feat: add option to remove undesired files #6

@TheSast

Description

@TheSast

Currently, when using wrapPackage or modules built on top of it, all binaries from the underlying package are made available, including anything that has an alias through the wrapper. In certain cases only a subset of those binaries may be desired.

My proposed solution would be a new configuration option (excludedBinaries or removeBinaries) that allows users to list binaries that should not be exposed.

wrappers.lib.wrapPackage {
  package = pkgs.hyfetch;
  excludedBinaries = [ "hyfetch" ]; # keep the maintaned neofetch fork "neowofetch" but exclude the main binary
}

By default, excludedBinaries / removeBinaries should be empty (preserving current behavior).
If a listed binary doesn’t exist in the package’s bin folder, the wrapper should ideally throw an error to help catch typos or mismatches early.

This feature would give users finer control over which executables are exposed and help avoid issues like:

  • Binary name collisions - e.g. nix-output-monitor and nom both provide a binary named nom.
  • Unwanted helper binaries being included when only a primary command is needed.

I understand if this kind of PATH cleanup is considered out of scope for the project, but it seemed like a natural extension of the existing wrapping system.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions