Configure nix during setup

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

View file

@ -78,7 +78,7 @@ begin
and arch-chroot "$mountDir" mkinitcpio -P and arch-chroot "$mountDir" mkinitcpio -P
and runHook installDrivers "Installing drivers..." || true and runHook installDrivers "Installing drivers..." || true
and pacstrap -K "$mountDir" fish jq nix tmux and runInOS fish "$tempDir/../../Common/Software/nix/main.fish" configure user
and arch-chroot "$mountDir" bash "$tempDir/../Software/sudo/install.sh" and arch-chroot "$mountDir" bash "$tempDir/../Software/sudo/install.sh"
and arch-chroot "$mountDir" bash "$tempDir/../Software/GRUB/install.sh" and arch-chroot "$mountDir" bash "$tempDir/../Software/GRUB/install.sh"

View file

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

View file

@ -0,0 +1,15 @@
#!/bin/env fish
begin
set -l dir (status dirname)
source "$dir/../../Scripts/software.fish"
function configureSW -V dir -a scope
if [ "$scope" = "user" ]
set -l configFile ~/.config/nix/nix.conf
mkdir -p (dirname "$configFile")
cp "$dir/../../../../archiso/airootfs/root/.config/nix/nix.conf" "$configFile"
end
end
runInstaller $argv
end