Skip to content

docs: avoid bash-specific process substitution in install command#1980

Open
Z-char wants to merge 3 commits into
NixOS:mainfrom
Z-char:fix-shell-install
Open

docs: avoid bash-specific process substitution in install command#1980
Z-char wants to merge 3 commits into
NixOS:mainfrom
Z-char:fix-shell-install

Conversation

@Z-char
Copy link
Copy Markdown

@Z-char Z-char commented Mar 16, 2026

The previous install command used process substitution:

$ sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon

Process substitution (<(...)) is not supported by all shells and is not part of the POSIX shell specification. This can cause the command to fail for users running the instructions in environments where the default shell does not implement this feature.

To make the command more portable, replace it with the pipe-based form used in the official nix.dev documentation:

$ curl -L https://nixos.org/nix/install | sh -s -- --daemon

I believe this will also fixes #1976 .

Avoid bash-specific process substitution in install command.
@github-actions
Copy link
Copy Markdown
Contributor

@thilobillerbeck
Copy link
Copy Markdown
Collaborator

Hi, I have some gripes I want to address here:

  1. your command drops some flags that the curl command previously had, I would like these to still persist
  2. I would rather not document unofficial sources of packaging, this will open up a massive rabbit hole and will draw people to us who are not responsible for the specific packages

Would be cool if you could address these points :)

Comment on lines +15 to +18
On Arch Linux, you can alternatively [install Nix through `pacman`](https://wiki.archlinux.org/title/Nix#Installation).

On Fedora, you can [install Nix via `dnf`](https://src.fedoraproject.org/rpms/nix).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not like to have this in here by now as it may seem official to some people and will put load on people that are not responsible for these forms of packaging

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not like to have this in here by now as it may seem official to some people and will put load on people that are not responsible for these forms of packaging

Maybe we can think about introducing a clearly marked unofficial packaging section


```bash prompt
$ sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon
$ curl -L https://nixos.org/nix/install | sh -s -- --daemon
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$ curl -L https://nixos.org/nix/install | sh -s -- --daemon
$ curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install | sh -s -- --daemon

this goes for the rest of commands

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fricklerhandwerk is there any reason nix.dev dropped these flags?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping the flags makes the command more explicit, which I think is helpful.

Although this may not fully align with the nix.dev script, I'll add the flags back for now until there's a unified recommendation across documentation.

We might need to solve NixOS/nix.dev#424 somehow.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These (all) variants should be kept in sync. --proto '=https' seems most valuable keeping everywhere to prevent from malicious redirects.

@fricklerhandwerk
Copy link
Copy Markdown
Contributor

fricklerhandwerk commented Mar 16, 2026

@thilobillerbeck On external packaging, a couple of years back I had the exact same stance. That was a time where those installations didn't work reliably and we even had the occasional complaint/support request we couldn't meaningfully address.

The NGI team solved that problem by running integration tests against installers known to work. So these days we know these are not broken, it's not a willy-nilly random pick of installation paths. I suggest leaving them.

Ideally we'd have an authoritative solution of course. On the technical side, arguably we only need @imincik or @eljamm to sit down with you and @hsjobeki to clarify a few things, and then port that stuff to here or nix.dev... We may or may not be able to organise this somewhat quickly, but there's an escalation path to SC/board now. And those would help for the social part: setting up lines of communication to maintainers of the other distros that ship Nix, so we can ask each other questions in case either side runs into problems.

Afte so many years, these issues can now be addressed properly. In principle...

@thilobillerbeck
Copy link
Copy Markdown
Collaborator

Weighting up leaving the flags in or quickly coming up with a long term solution I guess leaving the flags in obviously wins. :D

@github-actions
Copy link
Copy Markdown
Contributor

Comment thread core/src/content/download/01-nix-linux.mdx Outdated
@github-actions
Copy link
Copy Markdown
Contributor

@thilobillerbeck thilobillerbeck requested a review from hsjobeki May 17, 2026 13:06
@thilobillerbeck
Copy link
Copy Markdown
Collaborator

Just removed the distro specific part myself, @hsjobeki could you re-review your suggested changes are addressed now so this PR gets unblocked?

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.

Shell independent command to install nix

4 participants