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

support for container and non-systemd #75

Open
kwekewk opened this issue Dec 27, 2023 · 3 comments
Open

support for container and non-systemd #75

kwekewk opened this issue Dec 27, 2023 · 3 comments

Comments

@kwekewk
Copy link

kwekewk commented Dec 27, 2023

Hi, I'm new to Nix, and I find the determinate Nix installer somewhat awkward to deal with within a container. I always use the following to install for a single user, but I'm unsure if it's the best solution:

# Setup Nix
sudo install -d -m755 -o $(id -u) -g $(id -g) /nix
curl -L https://nixos.org/nix/install | sh

When crosup installing Flox, it causes an issue because it depends on the daemon. Is it due to [nix.install.pkg] being incompatible with the method above?

crosup install devenv
-> Checking if Nix is already installed
   Nix is /home/snoremote/.nix-profile/bin/nix
-> Nix is already installed, skipping
-> Checking if Cachix is already installed
bash: line 1: type: cachix: not found
-> Failed to check Cachix version
-> 🚚 Installing Cachix
bash: line 1: /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh: No such file or directory
-> Checking if Devenv is already installed
bash: line 1: type: devenv: not found
-> Failed to check Devenv version
-> 🚚 Installing Devenv
-> Running preinstall command:
echo "trusted-users = root $USER" | sudo tee -a /etc/nix/nix.conf
sudo pkill nix-daemon
cachix use devenv
bash: line 1: /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh: No such file or directory
bash: line 1: /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh: No such file or directory
bash: line 1: /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh: No such file or directory
bash: line 1: /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh: No such file or directory

It's the same with Flox, but it works with the official command line for a personal profile:

crosup install flox
-> Checking if Nix is already installed
   Nix is /home/snoremote/.nix-profile/bin/nix
-> Nix is already installed, skipping
-> Checking if Flox is already installed
bash: line 1: type: flox: not found
-> Failed to check Flox version
-> 🚚 Installing Flox
-> Running preinstall command:
echo 'extra-trusted-substituters = https://cache.floxdev.com' | sudo tee -a /etc/nix/nix.conf && echo 'extra-trusted-public-keys = flox-store-public-0:8c/B+kjIaQ+BloCmNkRUKwaVPFWkriSAd0JJvuDu4F0=' | sudo tee -a /etc/nix/nix.conf
bash: line 1: /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh: No such file or directory
bash: line 1: /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh: No such file or directory

I apologize if it's a bit incomprehensible. My question is: Is the above method a viable option for a container?

@tsirysndr
Copy link
Owner

Hi @kwekewk , thanks for reporting the issue.
I always use the determinate systems installer, but I think that in containers you need to pass the --init none option to nix determinate systems installer if you don't have systemd.

The error /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh: No such file or directory is due to the hardcoded source command in crosup here

@kwekewk
Copy link
Author

kwekewk commented Dec 27, 2023

Hi @kwekewk , thanks for reporting the issue. I always use the determinate systems installer, but I think that in containers you need to pass the --init none option to nix determinate systems installer if you don't have systemd.

Dumb question should it be okay to let a single user profile own /nix without depend on sudo?

@asggWa
Copy link

asggWa commented Jan 13, 2024

no entiendo esto

Repository owner deleted a comment Feb 2, 2024
Repository owner deleted a comment from tobarbaro Feb 10, 2024
Repository owner deleted a comment from Ripon9898 Feb 23, 2024
Repository owner deleted a comment from jmgrd98 Feb 23, 2024
Repository owner deleted a comment from adewalee-bot Feb 23, 2024
Repository owner deleted a comment from akashakki Mar 1, 2024
Repository owner deleted a comment from naudachu Mar 2, 2024
Repository owner deleted a comment from renato71amorim Mar 4, 2024
Repository owner deleted a comment from hyassine1 Mar 19, 2024
@github-staff github-staff deleted a comment from BenediktMiller Mar 23, 2024
@github-staff github-staff deleted a comment from AndreSabbagh Apr 26, 2024
@github-staff github-staff deleted a comment from thangtq-pionero Apr 26, 2024
@github-staff github-staff deleted a comment from maulanaayub May 12, 2024
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

No branches or pull requests

7 participants
@tsirysndr @asggWa @kwekewk and others