Skip to content

Commit

Permalink
fix: nix installer - switch back to nixos (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
bketelsen authored Mar 23, 2023
1 parent 1cea203 commit e7f14a4
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions usr/bin/ublue-nix-install
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ echo "Adding SELinux content to /var/lib/nix"
sudo semanage fcontext -a -t etc_t '/var/lib/nix/store/[^/]+/etc(/.*)?' ; sudo semanage fcontext -a -t lib_t '/var/lib/nix/store/[^/]+/lib(/.*)?' ; sudo semanage fcontext -a -t systemd_unit_file_t '/var/lib/nix/store/[^/]+/lib/systemd/system(/.*)?' ; sudo semanage fcontext -a -t man_t '/var/lib/nix/store/[^/]+/man(/.*)?' ; sudo semanage fcontext -a -t bin_t '/var/lib/nix/store/[^/]+/s?bin(/.*)?' ; sudo semanage fcontext -a -t usr_t '/var/lib/nix/store/[^/]+/share(/.*)?' ; sudo semanage fcontext -a -t var_run_t '/var/lib/nix/var/nix/daemon-socket(/.*)?' ; sudo semanage fcontext -a -t usr_t '/var/lib/nix/var/nix/profiles(/per-user/[^/]+)?/[^/]+'
echo "Creating service files"
sleep 1
echo "Creating SSL cert file"
sudo mkdir -p /etc/systemd/system/nix-daemon.service.d/
sudo tee /etc/systemd/system/nix-daemon.service.d/override.conf <<EOF
[Service]
Environment="NIX_SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt"
EOF
sleep 1
echo "Creating rootfs mkdir service"

Expand Down Expand Up @@ -72,16 +66,22 @@ sleep 1

echo "Preparing the nix install script"

sleep 5
sleep 2

curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm
sh <(curl -L https://nixos.org/nix/install) --daemon

echo "Nix installer has finished running"
sleep 1
echo "Copying service files"

sleep 1

echo "Creating SSL cert file"
sudo mkdir -p /etc/systemd/system/nix-daemon.service.d/
sudo tee /etc/systemd/system/nix-daemon.service.d/override.conf <<EOF
[Service]
Environment="NIX_SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt"
EOF
sudo rm -f /etc/systemd/system/nix-daemon.{service,socket} ; sudo cp /nix/var/nix/profiles/default/lib/systemd/system/nix-daemon.{service,socket} /etc/systemd/system/ ; sudo restorecon -RF /nix ; sudo systemctl daemon-reload ; sudo systemctl enable --now nix-daemon.socket

sleep 1
Expand All @@ -90,6 +90,9 @@ echo "Setting SELinux back to Enforcing"

sudo setenforce Enforcing

echo "Modifying /etc/nix/nix.conf"

This comment has been minimized.

Copy link
@bsherman

bsherman Mar 23, 2023

Contributor

@bketelsen I think you meant

echo "experimental-features = nix-command flakes" | sudo tee -a /etc/nix/nix.conf

This comment has been minimized.

Copy link
@bketelsen

bketelsen Mar 23, 2023

Author Member

probably so

sudo echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf

sleep 1

echo "You MUST reboot in order for the installation to finish"
Expand Down

0 comments on commit e7f14a4

Please sign in to comment.