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

Installation fails on Clear Linux*, presumably because directory /etc/tmpfiles.d doesn't exist by default #7990

Open
1 of 3 tasks
volkertb opened this issue Mar 6, 2023 · 7 comments

Comments

@volkertb
Copy link

volkertb commented Mar 6, 2023

Platform

  • Linux: Clear Linux* (version 38390)
  • macOS
  • WSL

Additional information

No additional steps: I performed the command sh <(curl -L https://nixos.org/nix/install) --daemon for the multi-user installation, as instructed at https://nixos.org/download.html

It's relevant to know that Clear Linux* uses systemd and does not use SELinux, which at least in theory should make is suitable for the multi-user install of Nix, right?

It does seem like Clear Linux* does not have the directory /etc/tmpfiles.d by default. Perhaps the script shouldn't blindly assume that this directory already exists in every Linux distro? I'll try manually creating that directory first and then rerunning the multi-user install command. I'll share my findings of that in a comment below.

Output

Output
~~> Setting up the nix-daemon systemd service

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

    $ sudo ln -sfn /nix/var/nix/profiles/default//lib/tmpfiles.d/nix-daemon.conf /etc/tmpfiles.d/nix-daemon.conf

to create the nix-daemon tmpfiles config

ln: failed to create symbolic link '/etc/tmpfiles.d/nix-daemon.conf': No such file or directory

Priorities

Add 👍 to issues you find important.

@volkertb
Copy link
Author

volkertb commented Mar 6, 2023

Yep, manually performing the command sudo mkdir /etc/tmpfiles.d before running the multi-user install command appears to do the trick.

Simply adding a mkdir -p mkdir /etc/tmpfiles.d to the script right before creating that symbolic link should be all that is needed to fix out-of-the-box compatibility with Clear Linux*, at least as far as the installation process is concerned. If I run into other issues while actually using Nix, I'll create separate issues for them.

Full installation log, just in case you want to verify things:

Output
  % 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  4052  100  4052    0     0   7768      0 --:--:-- --:--:-- --:--:--  7768
downloading Nix 2.14.1 binary tarball for x86_64-linux from 'https://releases.nixos.org/nix/nix-2.14.1/nix-2.14.1-x86_64-linux.tar.xz' to '/tmp/nix-binary-tarball-unpack.PPhSOD6ubH'...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 20.1M  100 20.1M    0     0  7665k      0  0:00:02  0:00:02 --:--:-- 7668k
Note: a multi-user installation is possible. See https://nixos.org/manual/nix/stable/installation/installing-binary.html#multi-user-installation
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 and groups that the Nix daemon uses to run
   builds.

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] y


I will:

 - make sure your computer doesn't already have Nix files
   (if it does, I will tell you how to clean them up.)
 - create local users (see the list above for the users I'll make)
 - create a local group (nixbld)
 - install Nix in to /nix
 - create a configuration file in /etc/nix
 - set up the "default profile" by creating some Nix-related files in
   /root
 - back up /etc/bashrc to /etc/bashrc.backup-before-nix
 - update /etc/bashrc to include some Nix configuration
 - back up /etc/zshrc to /etc/zshrc.backup-before-nix
 - update /etc/zshrc to include some Nix configuration
 - back up /etc/bash.bashrc to /etc/bash.bashrc.backup-before-nix
 - update /etc/bash.bashrc to include some Nix configuration
 - load and start a service (at /etc/systemd/system/nix-daemon.service
   and /etc/systemd/system/nix-daemon.socket) for nix-daemon

Ready to continue?
[y/n] y


---- 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!

~~> 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.

---- Nix config report ---------------------------------------------------------
        Temp Dir:	/tmp/tmp.jqOdpTiFSD
        Nix Root:	/nix
     Build Users:	32
  Build Group ID:	30000
Build Group Name:	nixbld

build users:
    Username:	UID
     nixbld1:	30001
     nixbld2:	30002
     nixbld3:	30003
     nixbld4:	30004
     nixbld5:	30005
     nixbld6:	30006
     nixbld7:	30007
     nixbld8:	30008
     nixbld9:	30009
     nixbld10:	30010
     nixbld11:	30011
     nixbld12:	30012
     nixbld13:	30013
     nixbld14:	30014
     nixbld15:	30015
     nixbld16:	30016
     nixbld17:	30017
     nixbld18:	30018
     nixbld19:	30019
     nixbld20:	30020
     nixbld21:	30021
     nixbld22:	30022
     nixbld23:	30023
     nixbld24:	30024
     nixbld25:	30025
     nixbld26:	30026
     nixbld27:	30027
     nixbld28:	30028
     nixbld29:	30029
     nixbld30:	30030
     nixbld31:	30031
     nixbld32:	30032

Ready to continue?
[y/n] y


~~> Setting up the build group nixbld
            Exists:	Yes

~~> Setting up the build user nixbld1
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 1
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld2
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 2
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld3
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 3
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld4
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 4
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld5
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 5
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld6
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 6
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld7
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 7
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld8
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 8
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld9
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 9
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld10
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 10
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld11
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 11
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld12
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 12
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld13
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 13
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld14
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 14
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld15
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 15
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld16
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 16
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld17
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 17
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld18
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 18
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld19
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 19
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld20
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 20
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld21
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 21
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld22
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 22
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld23
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 23
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld24
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 24
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld25
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 25
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld26
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 26
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld27
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 27
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld28
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 28
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld29
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 29
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld30
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 30
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld31
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 31
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld32
            Exists:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty
              Note:	Nix build user 32
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the basic directory structure

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

    $ sudo /bin/chown -R root:nixbld /nix

to take root ownership of existing Nix store files


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

    $ sudo install -dv -m 0755 /nix /nix/var /nix/var/log /nix/var/log/nix /nix/var/log/nix/drvs /nix/var/nix /nix/var/nix/db /nix/var/nix/gcroots /nix/var/nix/profiles /nix/var/nix/temproots /nix/var/nix/userpool /nix/var/nix/daemon-socket /nix/var/nix/gcroots/per-user /nix/var/nix/profiles/per-user

to make the basic directory structure of Nix (part 1)


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

    $ sudo install -dv -g nixbld -m 1775 /nix/store

to make the basic directory structure of Nix (part 2)


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

    $ sudo install -dv -m 0555 /etc/nix

to place the default nix daemon configuration (part 1)


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

    $ sudo install -m 0664 /tmp/tmp.jqOdpTiFSD/.nix-channels /root/.nix-channels

to set up the default system channel (part 1)


~~> Installing Nix

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

    $ sudo cp -RPp ./store/026hln0aq1hyshaxsdvhg0kmcm6yf45r-zlib-1.2.13 ./store/1f3pdcihv4mmgfsyw4jxqjvn7j5sc2xy-aws-c-mqtt-0.7.13 ./store/20d2d0jap81kxp5ng1igl7kkgnd077f3-libcpuid-0.6.2 ./store/34xlpp3j3vy7ksn09zh44f1c04w77khf-libunistring-1.0 ./store/3j1h6psl4pzn6b3yck6rk33bpwrmihb1-aws-c-common-0.8.5 ./store/3n9vwzn9wkq7cj93jp0s6gqpx1zbhvlj-libarchive-3.6.1-lib ./store/3rj4dwafjii1wi2f5va26hindims9zyz-boehm-gc-8.2.2 ./store/3z091ijyij0mmgi3iv0mp945lm2bx4wy-aws-checksums-0.1.13 ./store/4mxnw95jcm5a27qk60z7yc0gvxp42b9a-openssl-3.0.7 ./store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163 ./store/4rkhsf7sig2lh303bygqr3ph5mfwz0ah-s2n-tls-1.3.28 ./store/50si0kkawnfkgs8m7d8iv2zmkq0fdbm7-aws-c-event-stream-0.2.15 ./store/5glq0q102jva5p0h9ap0f1j9ps24gcc0-aws-sdk-cpp-1.9.294 ./store/5mh5019jigj0k14rdnjam1xwk5avn1id-libidn2-2.3.2 ./store/5q73izqsdasz81gma1nz6870b6220vkh-aws-crt-cpp-0.18.9 ./store/6qqybxxz6636jymz8x7l2sxj4np9yzsy-aws-c-cal-0.5.20 ./store/7b943a2k4amjmam6dnwnxnj8qbba9lbq-busybox-static-x86_64-unknown-linux-musl-1.35.0 ./store/7q41sbf04qcwv75j5bxis6pfjnmshy44-acl-2.3.1 ./store/816qwr4xy058451rbxr0ccyh1v1akhb6-keyutils-1.6.3-lib ./store/84px25a6dsmdg7ni7186rmkybq1k2vrf-aws-c-s3-0.1.51 ./store/9iy1ng7h1l6jdmjk157jra8n4hkrfdj1-brotli-1.0.9-lib ./store/9x6jfl84234im3f4gsrl1js3zyqz76jd-nlohmann_json-3.11.2 ./store/9yyfg6fzhs4sf454q2rf179kp3miy9mg-nix-2.14.1 ./store/a6q74vrxbsrmmw1z0fdzd0qrcm6dc0ll-aws-c-http-0.6.27 ./store/b7ac47isdc4z1ajln6adz3ppcjs1708b-libsodium-1.0.18 ./store/ba4f8msp39cfvfpw3m7fsalb4psw347z-nss-cacert-3.83 ./store/bwsyv47ri47ppr4ga34wd2khk89ch4n4-aws-c-auth-0.6.21 ./store/c8byvs0rj8vg5cpm5mswcg5dvp7d5ir7-libseccomp-2.5.4-lib ./store/cr5fmwri3601s7724ayjvckhsg6cz4rv-attr-2.5.1 ./store/dsd5gz46hdbdk2rfdimqddhq6m8m8fqs-bash-5.1-p16 ./store/f116ly4fl72zc5ynb03qrwdk2bp8y61p-aws-c-io-0.13.11 ./store/fph0r1qjhsygrb420y2zsfhjh3rssq0z-aws-c-sdkutils-0.1.7 ./store/h5slhj7gqpqh5q4jb00xdbcwbl8vqqa7-libxml2-2.10.3 ./store/il7dydwf1wfn9b4p4cii8q99b93i106n-editline-1.17.1 ./store/jpj9lx0p2h1vs3gkzj8jh350113bsm84-sqlite-3.39.4 ./store/mdck89nsfisflwjv6xv8ydj7dj0sj2pn-gcc-11.3.0-lib ./store/qz400bwshaqikj5s2qyvh0c9qffgmqik-nghttp2-1.49.0-lib ./store/r7gl900my2fw6k33nxh2r7rzv8nv0s25-libkrb5-1.20 ./store/rirzp6ijbcwnxlf0b2n286n587r3z9jw-curl-7.86.0 ./store/vqq9s0d6fw6kqf3sr5nrzqbys9rhygqd-libssh2-1.10.0 ./store/w10in9diaqrcqqxi5lg20n3q2jfpk6pq-zstd-1.5.2 ./store/w3sdhqiazzp4iy40wc2g85mv0grg1cx0-xz-5.2.7 ./store/wnxn8173p8gj888wwgv2l9czp7zf4jl3-aws-c-compression-0.2.16 ./store/ysl6qj5r7nn63b16954dhk7x47r5yq7i-bzip2-1.0.8 /nix/store/

to copy the basic Nix files to the new store at /nix/store


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

    $ sudo chmod -R ugo-w /nix/store/

to make the new store non-writable at /nix/store

      Alright! We have our first nix at /nix/store/9yyfg6fzhs4sf454q2rf179kp3miy9mg-nix-2.14.1

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

    $ sudo HOME=/root /nix/store/9yyfg6fzhs4sf454q2rf179kp3miy9mg-nix-2.14.1/bin/nix-store --load-db

to load data for the first time in to the Nix Database

      Just finished getting the nix database ready.

~~> Setting up shell profiles: /etc/bashrc /etc/profile.d/nix.sh /etc/zshrc /etc/bash.bashrc /etc/zsh/zshrc

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

    $ sudo cp /etc/bashrc /etc/bashrc.backup-before-nix

to back up your current /etc/bashrc to /etc/bashrc.backup-before-nix


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

    $ sudo tee -a /etc/bashrc

extend your /etc/bashrc with nix-daemon settings


# 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


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

    $ sudo cp /etc/zshrc /etc/zshrc.backup-before-nix

to back up your current /etc/zshrc to /etc/zshrc.backup-before-nix


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

    $ sudo tee -a /etc/zshrc

extend your /etc/zshrc with nix-daemon settings


# 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


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

    $ sudo cp /etc/bash.bashrc /etc/bash.bashrc.backup-before-nix

to back up your current /etc/bash.bashrc to /etc/bash.bashrc.backup-before-nix


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

    $ sudo tee -a /etc/bash.bashrc

extend your /etc/bash.bashrc with nix-daemon settings


# 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


~~> Setting up shell profiles for Fish with with conf.d/nix.fish inside /etc/fish /usr/local/etc/fish /opt/homebrew/etc/fish /opt/local/etc/fish
/tmp/nix-binary-tarball-unpack.PPhSOD6ubH/unpack/nix-2.14.1-x86_64-linux/install-multi-user: line 993: /etc/profile: No such file or directory

~~> Setting up the default profile

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

    $ sudo HOME=/root /nix/store/9yyfg6fzhs4sf454q2rf179kp3miy9mg-nix-2.14.1/bin/nix-env -i /nix/store/9yyfg6fzhs4sf454q2rf179kp3miy9mg-nix-2.14.1

to install a bootstrapping Nix in to the default profile

replacing old 'nix-2.14.1'
installing 'nix-2.14.1'

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

    $ sudo HOME=/root /nix/store/9yyfg6fzhs4sf454q2rf179kp3miy9mg-nix-2.14.1/bin/nix-env -i /nix/store/ba4f8msp39cfvfpw3m7fsalb4psw347z-nss-cacert-3.83

to install a bootstrapping SSL certificate just for Nix in to the default profile

replacing old 'nss-cacert-3.83'
installing 'nss-cacert-3.83'

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

    $ sudo HOME=/root NIX_SSL_CERT_FILE=/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt /nix/store/9yyfg6fzhs4sf454q2rf179kp3miy9mg-nix-2.14.1/bin/nix-channel --update nixpkgs

to update the default channel in the default profile

unpacking channels...

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

    $ sudo install -m 0664 /tmp/tmp.jqOdpTiFSD/nix.conf /etc/nix/nix.conf

to place the default nix daemon configuration (part 2)


~~> Setting up the nix-daemon systemd service

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

    $ sudo ln -sfn /nix/var/nix/profiles/default//lib/tmpfiles.d/nix-daemon.conf /etc/tmpfiles.d/nix-daemon.conf

to create the nix-daemon tmpfiles config


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

    $ sudo systemd-tmpfiles --create --prefix=/nix/var/nix

to run systemd-tmpfiles once to pick that path up


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

    $ sudo systemctl link /nix/var/nix/profiles/default/lib/systemd/system/nix-daemon.service

to set up the nix-daemon service

Created symlink /etc/systemd/system/nix-daemon.service → /nix/var/nix/profiles/default/lib/systemd/system/nix-daemon.service.

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

    $ sudo systemctl enable /nix/var/nix/profiles/default/lib/systemd/system/nix-daemon.socket

to set up the nix-daemon socket service

Created symlink /etc/systemd/system/nix-daemon.socket → /nix/var/nix/profiles/default/lib/systemd/system/nix-daemon.socket.
Created symlink /etc/systemd/system/sockets.target.wants/nix-daemon.socket → /nix/var/nix/profiles/default/lib/systemd/system/nix-daemon.socket.

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

    $ sudo systemctl daemon-reload

to load the systemd unit for nix-daemon


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

    $ sudo systemctl start nix-daemon.socket

to start the nix-daemon.socket


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

    $ sudo systemctl restart nix-daemon.service

to start the nix-daemon.service

Alright! We're done!
Try it! Open a new terminal, and type:

  $ nix-shell -p nix-info --run "nix-info -m"

Thank you for using this installer. If you have any feedback or need
help, don't hesitate:

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

---- Reminders -----------------------------------------------------------------
[ 1 ]
Nix won't work in active shell sessions until you restart them.

Press enter/return to acknowledge.

@volkertb
Copy link
Author

volkertb commented Mar 6, 2023

OK, I may have spoken too soon. The command nix-shell -p nix-info --run "nix-info -m" that the script advises me to run in a new terminal session, nix-shell -p nix-info --run "nix-info -m", doesn't work, even after logging out of GNOME and logging back in. Apparently, the PATH that /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh exports at the end doesn't "stick". It's either not being sourced correctly, or the PATH is completely overridden by another script somewhere. I do see other installations such as SDKMAN! and Cargo/rustup correctly in my PATH, though.

When I source the file manually, the nix-shell is found, but gives errors:

. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
nix-shell -p nix-info --run "nix-info -m"
error:
       … <borked>

         at «none»:0: (source not available)

       … while calling the 'import' builtin

         at «string»:1:18:

            1| {...}@args: with import <nixpkgs> args; (pkgs.runCommandCC or pkgs.runCommand) "shell" { buildInputs = [ (nix-info) ]; } ""
             |                  ^

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)

       at «none»:0: (source not available)

@volkertb
Copy link
Author

volkertb commented Mar 6, 2023

The daemon does appear to be running, though:

ps aux | grep nix-daemon | grep -v grep

Output:

root       64327  0.0  0.1 448656 25472 ?        Ssl  22:20   0:00 nix-daemon --daemon

@volkertb
Copy link
Author

volkertb commented Mar 6, 2023

The "borked" output might be because of this issue, and thus unrelated: #7937 (comment)

I'll try downgrading, as suggested in that comment.

@volkertb
Copy link
Author

volkertb commented Mar 6, 2023

Okay, the downgrade to 2.13.3 indeed made it work, although I still have to source the file /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh manually. Apparently, Clear Linux* seems to ignore all these files that the installation script modified:

  • /etc/bash.bashrc
  • /etc/bashrc
  • /etc/zshrc (Well, my shell is /bin/bash, so obviously this one isn't currently doing anything 😅)

I'll check the Clear Linux* documentation to figure out which shell configuration file(s) it uses instead.

@volkertb
Copy link
Author

volkertb commented Mar 6, 2023

If I understand this thread correctly, Clear Linux* only checks the file /etc/profile and any files under the directory /etc/profile.d. (Neither of these exist by default, but they will be picked up once they're created.)

I just tried the following commands:

sudo mkdir -p /etc/profile.d
sudo cp /etc/bashrc /etc/profile.d/nix  # (This is the `/etc/bashrc` file that was created by Nix multi-user install script)

And then I opened a new terminal session and ran nix-shell -p nix-info --run "nix-info -m" and this time it worked! 🥳

So to summarize, the following issues need to be resolved in order to fix compatibility with Clear Linux*:

  • The multi-user install script shouldn't blindly assume that the directory /etc/tmpfiles.d already exists.
  • The multi-user install script should add the same "if not already sourced, source nix-daemon.sh" to a newly created file under /etc/profile.d, preferably called nix, or otherwise it should append it to /etc/profile, although the former is preferable.
  • Issue nix-shell -p nix-info --run "nix-info -m" fails after installation. #7937 needs to be resolved (obviously)

I'll play around with Nix on Clear Linux* a bit more, and I'll add more findings as I encounter them. But at least the following commands appear to be working fine here now, after applying the aforementioned fixes/workarounds:

nix-channel --update
nix-channel --list
nix-shell -p nix-info --run "nix-info -m"

@abathur
Copy link
Member

abathur commented Mar 9, 2023

Apparently, Clear Linux* seems to ignore all these files that the installation script modified:
I'll check the Clear Linux* documentation to figure out which shell configuration file(s) it uses instead.

Environment inconsistencies like these are an under-appreciated source of complexity that the installer tries to contain. Thanks for actively picking at it.

A few questions to gather a little more information now:

  • I assume, given how recent 38390 appears to be, that this is a ~pristine Clear Linux install--but I guess it'll still be good to confirm whether there's been any restore/bootstrap/install activity that might merit double-checking things against a fresh install?
  • I imagine you're certain the shell is /bin/bash, but I just want to pick on that assumption a little in case there's a surprise here.
    • can you run chsh and confirm the shell path listed there?
    • can you report the version displayed by <path_from_chsh> --version
    • I assume the above will report some GNU bash version, but on the off chance it doesn't, it'd be good to figure out if it's a symlink or maybe an exec wrapper. file <path_from_chsh> and readlink <path_from_chsh> may be enough to disambiguate.
  • Have you confirmed none of these init files get sourced? (As opposed to just confirming you don't see the expected PATH change? We get a steady trickle of reports that trace back to some init file hard-setting the PATH after nix's init hook runs.) I guess echo $__ETC_PROFILE_NIX_SOURCED or set | grep NIX would probably be enough to verify.

I feel like I'm forgetting one, but that's a start at least.

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

No branches or pull requests

2 participants