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

Added Debian-based OS's profiles #4663

Merged
merged 1 commit into from
Mar 24, 2021
Merged

Added Debian-based OS's profiles #4663

merged 1 commit into from
Mar 24, 2021

Conversation

signed-log
Copy link
Contributor

Fixes #4662

Added /etc/bash.bashrc and /etc/zsh/zshenv as they replace /etc/bashrc and /etc/zshenv on Debian OS's

@bjornfor
Copy link
Contributor

+1.

Note that on e.g Ubuntu there is code in /etc/bash.bashrc to return early unless the shell is interactive. That means appending the nix code at the end of the file makes nix-copy-closure --to ubuntu-machine ... fail out-of-the-box.

@signed-log
Copy link
Contributor Author

+1.

Note that on e.g Ubuntu there is code in /etc/bash.bashrc to return early unless the shell is interactive. That means appending the nix code at the end of the file makes nix-copy-closure --to ubuntu-machine ... fail out-of-the-box.

Then, you can use sed to always put that at the top of the file

Something like :

sudo sed -i '1i source /etc/profile.d/nix.sh' /etc/bash.bashrc # Would work just fine with /etc/bashrc too

@bjornfor
Copy link
Contributor

Yes. Maybe something for a follow-up PR? (Btw, I don't have commit rights to this repo.)

@signed-log
Copy link
Contributor Author

Yes. Maybe something for a follow-up PR? (Btw, I don't have commit rights to this repo.)

I'm working on something to solve that issue

@bjornfor
Copy link
Contributor

[...] makes nix-copy-closure --to ubuntu-machine ... fail out-of-the-box.

There's already an issue about that: #2587

@edolstra edolstra merged commit 4e2c206 into NixOS:master Mar 24, 2021
@abathur
Copy link
Member

abathur commented Mar 31, 2021

Hmm.

In c40bad4 I changed the installer to start touching each profile target in order to fix up #3608, which seemed to be correct but only worked if /etc/zshenv already existed.

I don't really know if there's a non-obnoxious way to address it, but the installer will create and populate all of the profile targets for all users. I'm not quite sure if this will just amount to a little littering, or if creating all of the files will mess up anyone's start-up order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix profile sourcing on Debian-based OS's
4 participants