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

question: standalone home-manager copies untracked files to /nix/store/****-source #5594

Open
2 tasks done
shirakami-chigusa opened this issue Jul 1, 2024 · 2 comments
Open
2 tasks done
Assignees
Labels
bug triage Issues or feature request that have not been triaged yet

Comments

@shirakami-chigusa
Copy link

shirakami-chigusa commented Jul 1, 2024

Are you following the right branch?

  • My Nixpkgs and Home Manager versions are in sync

Is there an existing issue for this?

  • I have searched the existing issues

Issue description

I'm having trouble because files that are excluded with .gitignore are copied to /nix/store/12afkpbag242i7w9lb26bk**********-source/.

I confirmed by the following steps:

  1. create untracked file ~/.config/home-manager/test-untracked.txt.
  2. run home-manager swith with flake.nix. ~/.config/home-manager itself is copied to /nix/store/12afkpbag242i7w9lb26bk**********-source/ as source tree.
  3. fd -IH "test-untracked.txt" /nix/store/ shows /nix/store/12afkpbag242i7w9lb26bk**********-source/test-untracked.txt

/nix/store/12afkpbag242i7w9lb26bk**********_source includes untracked cache files .DS_Store .git .lsp/.cache .clj-kondo/.cache. test-untracked.txt is also included.

In particular, .clj-kondo/.cache takes a long time to copy because it is over 50MB and consists of over 10,000 small files. If .clj-kondo/.cache exists, time home-manager switch will be about 30 seconds. If it is removed it will be 3 seconds.

These cache files are listed in .gitignore, but home-manager switch does not seem to use .gitignore. Is there a source filter for the .config/home-manager directory?

Is this a flake issue rather than a home-manager issue? I think the nixos-rebuild switch does not copy untracked files, but the home-manager switch does copy them.

Maintainer CC

No response

System information

- system: `"aarch64-darwin"`
 - host os: `Darwin 23.5.0, macOS 14.5`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.20.5`
 - nixpkgs: `/nix/store/rhg90jpryc286xn9xjy6qjiaap6pjgdc-source`

I am not using nix-darwin. using home-manager switch.

@shirakami-chigusa shirakami-chigusa added bug triage Issues or feature request that have not been triaged yet labels Jul 1, 2024
@shirakami-chigusa
Copy link
Author

shirakami-chigusa commented Jul 13, 2024

Since the nixos-rebuild switch depends on git, the test-untracked.txt that has not been added will not be copied.

So when I ran home-manager as nixosModules, it correctly ignored test-untracked.txt.

touch test-untraced.txt
sudo nixos-rebuild switch --flake .#foo
fd "test-untracked.txt" /nix/store/
# print nothing.
git add test-untraced.txt
sudo nixos-rebuild switch --flake .#foo
fd "test-untracked.txt" /nix/store/
# print /nix/store/8qwq3ic74whwc18yvwrzxmynlx7qh457-source/test-untracked.txt

The standalone home-manager switch does not ignore test-untracked.txt.

System information

 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.37, NixOS, 24.05 (Uakari), 24.05.20240711.a046c12`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.4`
 - nixpkgs: `/nix/store/2k0r4pk0hzjzk9iwyi61xc0z4qv791j9-source`

@shirakami-chigusa
Copy link
Author

I also tested it on nix-darwin.

touch test-untraced.txt
darwin-rebuild switch --flake .
fd "test-untracked.txt" /nix/store/
# print nothing.
git add test-untraced.txt
darwin-rebuild switch --flake .
fd "test-untracked.txt" /nix/store/
# print /nix/store/wdx2n3l5vi72l9a2sqppzila41lg7icq-source/zxcvb.txt

System information

 - system: `"aarch64-darwin"`
 - host os: `Darwin 23.5.0, macOS 14.5`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.18.5`
 - nixpkgs: `/nix/store/038zs5b21569pjv6v0dwhi6fd95jbzvx-source

@shirakami-chigusa shirakami-chigusa changed the title question: home-manager copies untracked files to /nix/store/****-source question: standalone home-manager copies untracked files to /nix/store/****-source Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug triage Issues or feature request that have not been triaged yet
Projects
None yet
Development

No branches or pull requests

4 participants