Configure nix during setup

This commit is contained in:
Manuel Thalmann 2024-07-16 22:17:07 +02:00
commit 476d56cf3f
3 changed files with 20 additions and 7 deletions
scripts/Common/OS

View file

@ -3,14 +3,12 @@ set -l dir (status dirname)
source "$dir/../Scripts/config.fish"
source "$dir/../Scripts/hooks.fish"
function copyNixConfig -V dir
set -l configFile ~/.config/nix/nix.conf
mkdir -p (dirname "$configFile")
cp "$dir/../../../archiso/airootfs/root/.config/nix/nix.conf" "$configFile"
function configureNix -V dir
source "$dir/../Software/nix/main.fish" configure user
end
if [ (id -u) -eq 0 ]
copyNixConfig
configureNix
set -l name (getConfig valhalla.setupUser.name)
set -l sudoConfig "/etc/sudoers.d/PortValhalla"
@ -34,7 +32,7 @@ if [ (id -u) -eq 0 ]
rm "$sudoConfig"
userdel -r "$name"
else
copyNixConfig
configureNix
source "$dir/../Software/bash/main.fish"
runHook initialize || true
runHook installDrivers || true