Skip to content

flakes: respect .ignore when excluding files copied to nix store #9996

@colemickens

Description

@colemickens

Is your feature request related to a problem? Please describe.

Hi,

I'm switching to jj from git as my primary way of interacting with upstream git repos. (It's really good, i can't praise it enough). However, this causes some issues when I don't use a co-located git repo.

Nix decides that it's not a git repo (fair), and then proceeds to copy everything into the store, including otherwise .gitignore or .ignored files (unfortunate).

Besides this being bloaty/wasteful, this includes things like postgres state files, which are not able to be copied to the store.

Describe the solution you'd like

If a .ignore is present (maybe symlinked to .gitignore), nix will use that as an exclude filter when copying to the store.

Describe alternatives you've considered

Not much, I assume there's .hgignore support, or whatnot, this feels like an easy/safe win at first glance.

Additional context
n/a

Priorities

Add 👍 to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureFeature request or proposal
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions