Configure nix during setup
This commit is contained in:
parent
20f45a5cc1
commit
476d56cf3f
3 changed files with 20 additions and 7 deletions
|
@ -78,7 +78,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"
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
15
scripts/Common/Software/nix/main.fish
Normal file
15
scripts/Common/Software/nix/main.fish
Normal 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
|
Loading…
Reference in a new issue