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

macOS Installer doesn't handle a .zshrc file that doesn't end with a newline #5068

Closed
hborders opened this issue Jul 29, 2021 · 2 comments
Closed
Labels

Comments

@hborders
Copy link

Describe the bug

The installer appends the nix source imports directly to the end of the .zshrc file. When I run the installer on macOS 11.4 with a .zshrc file that doesn't end with a newline, the installer creates a zsh syntax error because my file ends with a fi, so my last line starts with:

fiif [

If you have a problem with a specific package or NixOS,
you probably want to file an issue at https://github.com/NixOS/nixpkgs/issues.

Steps To Reproduce

  1. Create a macOS EC2 instance with the macOS 11.4 image: ami-0b3c31b0c66a46614
  2. Ensure your ~/.zshrc file doesn't end in a newline
  3. Run the installer in single-user mode:
sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume
  1. Open a new terminal session
  2. See error

Expected behavior

The installer handles .zshrc files that don't end in a newline. I realize that well-behaved unix text files should end with a newline, but the AWS EC2 image doesn't. Adding a newline before appending the source loading is a small price to pay.

@hborders hborders added the bug label Jul 29, 2021
@abathur
Copy link
Member

abathur commented Jul 30, 2021

I think this is the same case described in #4990 and according to #4990 (comment) there's a fix in master already that isn't backported to 2.3. If you try the numtide installer I mentioned in #4779 (comment), can you confirm that you don't see this behavior?

@hborders
Copy link
Author

Yes, this does look the same as #4990. I'll close this.

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

2 participants