From 22e043e4caafc36e9028816c52df5c03bbc47f64 Mon Sep 17 00:00:00 2001 From: Luis Guilherme Coelho Date: Mon, 4 Nov 2024 19:13:29 -0300 Subject: [PATCH] operating-systems: buer: Add installation scripts --- operating-systems/buer/install/01-prepare.sh | 3 +++ operating-systems/buer/install/02-create.sh | 10 ++++++++++ operating-systems/buer/install/03-init.sh | 3 +++ operating-systems/buer/install/04-cleanup.sh | 3 +++ operating-systems/buer/install/05-populate.sh | 1 + operating-systems/buer/install/06-permissions.sh | 3 +++ 6 files changed, 23 insertions(+) create mode 100755 operating-systems/buer/install/01-prepare.sh create mode 100755 operating-systems/buer/install/02-create.sh create mode 100755 operating-systems/buer/install/03-init.sh create mode 100755 operating-systems/buer/install/04-cleanup.sh create mode 100755 operating-systems/buer/install/05-populate.sh create mode 100755 operating-systems/buer/install/06-permissions.sh diff --git a/operating-systems/buer/install/01-prepare.sh b/operating-systems/buer/install/01-prepare.sh new file mode 100755 index 0000000..c011898 --- /dev/null +++ b/operating-systems/buer/install/01-prepare.sh @@ -0,0 +1,3 @@ +guix shell git -- git clone https://codeberg.org/anemofilia/radix +echo "Format your disk and mount the btrfs partition on /mnt." +echo "After that, run 02-create.sh" diff --git a/operating-systems/buer/install/02-create.sh b/operating-systems/buer/install/02-create.sh new file mode 100755 index 0000000..618e741 --- /dev/null +++ b/operating-systems/buer/install/02-create.sh @@ -0,0 +1,10 @@ +cd /mnt +mkdir -p boot home root gnu/store gnu/persist var/log var/lib var/guix + +for vol in home root boot gnu gnu/store gnu/persist var var/log var/lib var/guix; do + btrfs subvolume create @$vol + mount --bind @$vol $vol +done + +cd @gnu/persist +mkdir -p etc/guix etc/ssh etc/wireguard diff --git a/operating-systems/buer/install/03-init.sh b/operating-systems/buer/install/03-init.sh new file mode 100755 index 0000000..9b9f9b4 --- /dev/null +++ b/operating-systems/buer/install/03-init.sh @@ -0,0 +1,3 @@ +herd start cow-store /mnt +export GUILE_LOAD_PATH=/root/radix:/root/zero:/root/zero/home-environments:/root/zero:operating-systems:$GUILE_LOAD_PATH +guix system init /root/zero/operating-systems/buer.scm /mnt diff --git a/operating-systems/buer/install/04-cleanup.sh b/operating-systems/buer/install/04-cleanup.sh new file mode 100755 index 0000000..70b982e --- /dev/null +++ b/operating-systems/buer/install/04-cleanup.sh @@ -0,0 +1,3 @@ +cd /mnt +umount home root boot gnu/store gnu/persist var/log var/lib var/guix +rm -rf home root boot bin etc gnu mnt tmp var diff --git a/operating-systems/buer/install/05-populate.sh b/operating-systems/buer/install/05-populate.sh new file mode 100755 index 0000000..8b1e797 --- /dev/null +++ b/operating-systems/buer/install/05-populate.sh @@ -0,0 +1 @@ +guix shell dbus -- dbus-uuidgen > /mnt/@gnu/persist/etc/machine-id diff --git a/operating-systems/buer/install/06-permissions.sh b/operating-systems/buer/install/06-permissions.sh new file mode 100755 index 0000000..e001b5d --- /dev/null +++ b/operating-systems/buer/install/06-permissions.sh @@ -0,0 +1,3 @@ +chmod 700 /mnt/@root +chmod 644 /mnt/@gnu/persist/etc/machine-id +chmod 600 /mnt/@gnu/persist/etc/{wireguard,ssh,guix}