Add install script

buersako
Luis Guilherme Coelho 2024-11-03 18:21:30 -03:00
parent 033c37d764
commit 0fa167724c
No known key found for this signature in database
GPG Key ID: 1F2E76ACE3F531C8
1 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,42 @@
set -exu
# Mounting
mount -L guix /mnt
cd /mnt
for dir in boot root home var/log var/guix gnu/persist gnu/store; do
mkdir -p $dir; btrfs subvolume create @$dir; mount --bind @$dir $dir
done
cd @gnu/persist
mkdir -p /etc/guix /etc/ssh /etc/wireguard
cd
# Connection
rfkill unblock wifi
wpa_supplicant -B -i wlp2s0 -c <(wpa_passphrase 'AP24' 'Floresta123@')
dhclient
# Initialization
guix shell git -- git clone codeberg.org/anemofilia/radix
guix shell git -- git clone codeberg.org/anemofilia/zero
export GUILE_LOAD_PATH="zero:zero/operating-systems:radix:$GUILE_LOAD_PATH"
guix system init zero/operating-systems/buer.scm /mnt
# Cleaning
cd /mnt
for dir in boot root home var/log var/guix gnu/persist gnu/store; do
umount $dir; rm -rf $dir
done
# Populate
guix shell dbus -- dbus-uuidgen > @gnu/persist/etc/machine-id
cp -r /etc/ssh/* @gnu/persist/etc/ssh
cp -r /etc/guix/* @gnu/persist/etc/guix
# Permissions
chmod 700 @root
cd @gnu/persist/etc/
chmod 644 machine-id
chmod 600 guix ssh wireguard