Page MenuHomePhabricator

[Nix] Configure nix before attempting Powerline install
ClosedPublic

Authored by jon on Aug 17 2022, 7:08 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 10, 5:35 AM
Unknown Object (File)
Sun, Nov 3, 7:45 PM
Unknown Object (File)
Sun, Nov 3, 7:45 PM
Unknown Object (File)
Sun, Nov 3, 7:44 PM
Unknown Object (File)
Sun, Nov 3, 7:26 PM
Unknown Object (File)
Sep 26 2024, 9:14 PM
Unknown Object (File)
Sep 26 2024, 9:14 PM
Unknown Object (File)
Sep 26 2024, 9:14 PM
Subscribers

Details

Summary

The nix build and nix eval commands need
the experimental features enabled in the nix.conf before these can succeed.

Originally just ordered the events by my task order, but the ordering needs to
configure nix first on a true new nix install.

Depends on D4816

Test Plan

From a machine which doesn't have nix on it:

./scripts/install_nix.sh
# validate nix and flakes are enabled
nix run nixpkgs#cowsay -- it works!

Or from a existing mac machine with nix on it:

# Revert nix.conf to its original install state
echo "build-users-group = nixbld" | sudo tee /etc/nix/nix.conf > /dev/null

# Run script
./scripts/install_nix.sh

# Check contents have changed
cat /etc/nix/nix.conf

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jon edited the test plan for this revision. (Show Details)

sudo tee /etc/nix/nix.conf > /dev/null

I have a question, why do we need to redirect stdout to dev/null (ignore it by the shell)? On line 41 of install_nix.sh, we also do the same except we redirect both stdout and stderr to dev/null. Is this so the user doesn't have to see specific error messages/encapsulation?

Also running into this error when running ./scripts/install_nix.sh:

abosh@Aboshs-MacBook-Air ~/comm (master)> echo "build-users-group = nixbld" | sudo tee /etc/nix/nix.conf > /dev/null

abosh@Aboshs-MacBook-Air ~/comm (master)> cat /etc/nix/nix.conf
build-users-group = nixbld

abosh@Aboshs-MacBook-Air ~/comm (master)> ./scripts/install_nix.sh
error: experimental Nix feature 'nix-command' is disabled; use '--extra-experimental-features nix-command' to override
error: experimental Nix feature 'nix-command' is disabled; use '--extra-experimental-features nix-command' to override
./scripts/install_nix.sh: line 30: /bin/better-prompt: No such file or directory

abosh@Aboshs-MacBook-Air ~/comm (master)> cat /etc/nix/nix.conf
build-users-group = nixbld
trusted-users = @admin abosh
experimental-features = flakes nix-command
cores = 4
max-jobs = 4

image.png (1×2 px, 476 KB)

This revision now requires changes to proceed.Aug 17 2022, 8:13 AM

I have a question, why do we need to redirect stdout to dev/null

tee also outputs to stdout, so it is just weird, but inert. I'm just using tee so that it can write as root.

Also running into this error when running ./scripts/install_nix.sh:

I noticed that you're on master. This PR is to address this exact issue. You can do arc patch D4862 and then try again.

I noticed that you're on master. This PR is to address this exact issue. You can do arc patch D4862 and then try again.

My bad 🤦 I'll try again.

This revision is now accepted and ready to land.Aug 17 2022, 9:50 AM