Configure nix during setup

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

View file

@ -86,7 +86,7 @@ begin
and arch-chroot "$mountDir" mkinitcpio -P
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/GRUB/install.sh"

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

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