Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Untracked files excluded from flake even with "path:" input #11930

Open
cecchi opened this issue Nov 21, 2024 · 0 comments
Open

Untracked files excluded from flake even with "path:" input #11930

cecchi opened this issue Nov 21, 2024 · 0 comments
Labels

Comments

@cecchi
Copy link

cecchi commented Nov 21, 2024

Describe the bug

I am a new Nix user. After discovering that files that are untracked by git are not included in Nix flakes, I found a suggested workaround to use a path: input: https://hackmd.io/@nix-ux/Hkvf16Xw5?print-pdf#/

Unfortunately, neither of these result in the untracked file(s) being included:

inputs = {
  local-src = "path:";
};
inputs = {
  local-src = {
    url = "path:";
    flake = false;
  };
};

However, if I use --override-input local-src "path:" it does work (even though as far as I can tell I am overriding the value with the exact same value).

Without override (untracked files are not included):

> nix build .#buildApp
error: builder for '/nix/store/qlc9344v6qm1cz7gnimxly73csvbzqn0-foo.drv' failed with exit code 1;
       last 17 log lines:
       # ... edited for brevity ...
       > Running phase: installPhase
       > No ignore.txt

With override (untracked files are included):

> nix build .#buildApp --override-input local-src "path:"
• Updated input 'local-src':
    'path:?lastModified=0&narHash=sha256-V416LmrnNZ55aFRBeYrKsdW%2BCJmkEmPnS5W6pa1q0rs%3D' (1970-01-01)
  → 'path:?lastModified=1732159360&narHash=sha256-jNUXrWnLZid%2BPehmOvk8/pDM%2BaIG1AUPugxO3%2BUv4PQ%3D' (2024-11-21)

Steps To Reproduce

I have created a minimal reproduction repo here: https://github.com/cecchi/nix-path-input-bug-repro

Expected behavior

  1. There should be a clear and documented way to include files that are not tracked by git (Add option to include untracked files in git and mercurial fetchers #9352)
  2. The --override-input argument should not change the behavior when setting the same value

nix-env --version output

nix-env (Nix) 2.25.0

Priorities

Add 👍 to issues you find important.

@cecchi cecchi added the bug label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant