Skip to content

The installer said I should open a issue because bashrc file don't related to nix but still failed #15146

@LaoshuBaby

Description

@LaoshuBaby

Platform

  • Linux:
  • macOS
  • WSL

Additional information

laoshubaby@laoshubabywithinstantnoodle bakbashrcfornix % ls 
bashrc                          bashrc.backup-before-nix
laoshubaby@laoshubabywithinstantnoodle bakbashrcfornix % cat bashrc.backup-before-nix 
# System-wide .bashrc file for interactive bash(1) shells.
if [ -z "$PS1" ]; then
   return
fi

PS1='\h:\W \u\$ '
# Make bash check its window size after a process completes
shopt -s checkwinsize

[ -r "/etc/bashrc_$TERM_PROGRAM" ] && . "/etc/bashrc_$TERM_PROGRAM"
laoshubaby@laoshubabywithinstantnoodle bakbashrcfornix % cat bashrc

# Nix
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
  . '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
# End Nix

# System-wide .bashrc file for interactive bash(1) shells.
if [ -z "$PS1" ]; then
   return
fi

PS1='\h:\W \u\$ '
# Make bash check its window size after a process completes
shopt -s checkwinsize

[ -r "/etc/bashrc_$TERM_PROGRAM" ] && . "/etc/bashrc_$TERM_PROGRAM"
laoshubaby@laoshubabywithinstantnoodle bakbashrcfornix % 

Output

laoshubaby@laoshubabywithinstantnoodle ~ % sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  4267  100  4267    0     0   4051      0  0:00:01  0:00:01 --:--:--  4051
downloading Nix 2.33.2 binary tarball for x86_64-darwin from 'https://releases.nixos.org/nix/nix-2.33.2/nix-2.33.2-x86_64-darwin.tar.xz' to '/var/folders/bh/r0dp0m9n72lggngdjm_7gd2c0000gn/T/nix-binary-tarball-unpack.XXXXXXXXXX.ASiHzEcw'...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 28.0M  100 28.0M    0     0  9889k      0  0:00:02  0:00:02 --:--:-- 9917k
Switching to the Multi-user Installer
Welcome to the Multi-User Nix Installation

This installation tool will set up your computer with the Nix package
manager. This will happen in a few stages:

1. Make sure your computer doesn't already have Nix. If it does, I
   will show you instructions on how to clean up your old install.

2. Show you what I am going to install and where. Then I will ask
   if you are ready to continue.

3. Create the system users (uids [351..382]) and groups (gid 350)
   that the Nix daemon uses to run builds. To create system users
   in a different range, exit and run this tool again with
   NIX_FIRST_BUILD_UID set.

4. Perform the basic installation of the Nix files daemon.

5. Configure your shell to import special Nix Profile files, so you
   can use Nix.

6. Start the Nix daemon.

Would you like to see a more detailed list of what I will do?
[y/n] n


---- let's talk about sudo -----------------------------------------------------
This script is going to call sudo a lot. Every time I do, it'll
output exactly what it'll do, and why.

Just like this:

---- sudo execution ------------------------------------------------------------
I am executing:

    $ sudo echo

to demonstrate how our sudo prompts look


This might look scary, but everything can be undone by running just a
few commands. I used to ask you to confirm each time sudo ran, but it
was too many times. Instead, I'll just ask you this one time:

Can I use sudo?
[y/n] y

Yay! Thanks! Let's get going!

~~> Fixing any leftover Nix volume state
Before I try to install, I'll check for any existing Nix volume config
and ask for your permission to remove it (so that the installer can
start fresh). I'll also ask for permission to fix any issues I spot.

---- Found existing Nix volume -------------------------------------------------
  special:      disk1s7
     uuid:      995EA8A2-3C09-4A8A-9B64-13FF4C3A9EB0
encrypted:      no

~~> Checking for artifacts of previous installs
Before I try to install, I'll check for signs Nix already is or has
been installed on this system.

---- oh no! --------------------------------------------------------------------
I back up shell profile/rc scripts before I add Nix to them.
I need to back up /etc/zshrc to /etc/zshrc.backup-before-nix,
but the latter already exists.

Here's how to clean up the old backup file:

1. Back up (copy) /etc/zshrc and /etc/zshrc.backup-before-nix
   to another location, just in case.

2. Ensure /etc/zshrc.backup-before-nix does not have anything
   Nix-related in it. If it does, something is probably quite
   wrong. Please open an issue or get in touch immediately.

3. Once you confirm /etc/zshrc is backed up and
   /etc/zshrc.backup-before-nix doesn't mention Nix, run:
   mv /etc/zshrc.backup-before-nix /etc/zshrc

We'd love to help if you need it.

You can open an issue at
https://github.com/NixOS/nix/issues/new?labels=installer&template=installer.md

Or get in touch with the community: https://nixos.org/community
laoshubaby@laoshubabywithinstantnoodle ~ % 

Checklist


Add 👍 to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions