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

bug: home-manager not respecting build-dir when set in /etc/nix/nix.conf? #6564

Open
2 tasks done
johanneskastl opened this issue Mar 2, 2025 · 1 comment
Open
2 tasks done
Assignees
Labels
bug triage Issues or feature request that have not been triaged yet

Comments

@johanneskastl
Copy link

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

Dear maintainers,

as discussed in https://discourse.nixos.org/t/permanently-use-a-sandbox-build-directory-outside-of-tmp/60353/, I am using home-manager on a Fedora-based device with only 8GB of RAM. Hence the tmpfs in /tmp is too small, while /var/tmp/ has enough space.

Setting build-dir in /etc/nix/nix.conf (or /etc/nix/nix.custom.conf) shows this setting when running nix config show:

$ nix config show|grep build-dir
build-dir = /var/tmp
sandbox-build-dir = /build

(As far as I found this obseletes setting the TMPDIR variable in the nix-daemon systemd unit file)

However, when using home-manager, I always need to prefix the command with TMPDIR=/var/tmp/, otherwise the build fails due to missing space in /tmp.

# working
$ nix-channel --update && TMPDIR=/var/tmp/ home-manager switch
# failing
$ nix-channel --update && home-manager switch
$

I searched a lot on how to set this in the home-manager configuration itself somewhere, but of course those are lousy search terms so I might just have missed it.

Is there an option that I need to set so this is being respected? Or is this a bug that needs to be fixed?

Thanks in advance!

Kind Regards,
Johannes

Maintainer CC

No response

System information

- system: `"x86_64-linux"`
 - host os: `Linux 6.12.10-200.fc41.x86_64, Aurora, 41.20250302 (Kinoite), ddd565a`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.26.1`
 - nixpkgs: `/nix/store/w3ghsxcwcynh88fgr7j841drw08fyzn0-nixpkgs-24.11/nixpkgs`
@johanneskastl johanneskastl added bug triage Issues or feature request that have not been triaged yet labels Mar 2, 2025
@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/permanently-use-a-sandbox-build-directory-outside-of-tmp/60353/6

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

5 participants