From 36b5b4eb0907487665e766b66802ee93ea53c015 Mon Sep 17 00:00:00 2001 From: Daniel Ziltener Date: Tue, 12 Dec 2023 13:04:09 +0100 Subject: [PATCH] . --- install-guix-on-void-root.bash | 46 +++++++++++++++++++++++++++++ install-guix-on-void.bash | 54 ++++------------------------------ 2 files changed, 52 insertions(+), 48 deletions(-) create mode 100644 install-guix-on-void-root.bash diff --git a/install-guix-on-void-root.bash b/install-guix-on-void-root.bash new file mode 100644 index 0000000..dd1094d --- /dev/null +++ b/install-guix-on-void-root.bash @@ -0,0 +1,46 @@ +#!/usr/bin/env bash +xbps-install -SuA wget curl brightnessctl pam_rundir seatd polkit mdevd mesa-dri gnupg2 xz NetworkManager +curl -L https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh > guix-install.sh +which guix || bash guix-install.sh +yes | guix install shepherd + +sed -i '/pam_rundir/{h;s/^.*$/-session optional pam_rundir.so/};${x;/^$/{s//-session optional pam_rundir.so/;H};x}' /etc/pam.d/system-login + +# Guix Daemon +mkdir -p /etc/sv/guix-daemon/log +cat <<'EOF' > /etc/sv/guix-daemon/run +#!/bin/sh +exec 2>&1 +exec ~root/.config/guix/current/bin/guix-daemon --build-users-group=guixbuild +EOF +chmod +x /etc/sv/guix-daemon/run + +cat < /etc/sv/guix-daemon/log/run +#!/bin/sh +exec vlogger -t guix-daemon -p daemon +EOF +chmod +x /etc/sv/guix-daemon/log/run + +# Shepherd Daemon +mkdir -p /etc/sv/shepherd/log +cat < /etc/sv/shepherd/run +#!/bin/sh +exec 2>&1 +exec $(find /gnu -wholename '*/bin/shepherd') +EOF +chmod +x /etc/sv/shepherd/run + +cat < /etc/sv/shepherd/log/run +#!/bin/sh +exec vlogger -t shepherd -p daemon +EOF +chmod +x /etc/sv/shepherd/log/run + +# Enable Daemons +for DAEMON in guix-daemon shepherd NetworkManager acpid dbus mdevd polkitd seatd mdevd +do + ln -sf /etc/sv/$DAEMON /var/service/ +done + +# Add user to groups +usermod -a -G seat zilti diff --git a/install-guix-on-void.bash b/install-guix-on-void.bash index ea61287..1e986ed 100644 --- a/install-guix-on-void.bash +++ b/install-guix-on-void.bash @@ -1,55 +1,13 @@ -#!/usr/local/env bash - xbps-install -SuA wget curl brightnessctl pam_rundir seatd polkit mdevd mesa-dri gnupg2 xz - ln -sf /etc/sv/nscd /var/service/ -curl -L https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh > guix-install.sh - which guix || bash guix-install.sh - guix install shepherd +#!/usr/bin/env bash - sed -i '/pam_rundir/{h;s/^.*$/-session optional pam_rundir.so/};${x;/^$/{s//-session optional pam_rundir.so/;H};x}' /etc/pam.d/system-login - -# Guix Daemon - mkdir -p /etc/sv/guix-daemon/log - cat <<'EOF' > /etc/sv/guix-daemon/run -#!/bin/sh -exec 2>&1 -exec ~root/.config/guix/current/bin/guix-daemon --build-users-group=guixbuild -EOF - chmod +x /etc/sv/guix-daemon/run - - cat < /etc/sv/guix-daemon/log/run -#!/bin/sh -exec vlogger -t guix-daemon -p daemon -EOF - chmod +x /etc/sv/guix-daemon/log/run - - ln -sf /etc/sv/guix-daemon /var/service/ - -# Shepherd Daemon - mkdir -p /etc/sv/shepherd/log - cat < /etc/sv/shepherd/run -#!/bin/sh -exec 2>&1 -exec $(find /gnu -wholename '*/bin/shepherd') -EOF - chmod +x /etc/sv/shepherd/run - - cat < /etc/sv/shepherd/log/run -#!/bin/sh -exec vlogger -t shepherd -p daemon -EOF - chmod +x /etc/sv/shepherd/log/run - - ln -sf /etc/sv/shepherd /var/service/ - -# Enable Daemons - -for DAEMON in guix-daemon shepherd NetworkManager acpid dbus nscd polkitd seatd mdevd +sudo bash ./install-guix-on-void-root.bash # Profile Initialization -cat <<'EOF' >> ~/.profile +cat << 'EOF' > ~/.profile GUIX_PROFILE="/home/zilti/.config/guix/current" . "$GUIX_PROFILE/etc/profile" EOF -#guix pull -#guix home reconfigure ./home/home-configuration.scm +guix pull +. ~/.profile +guix home reconfigure ./home/home-configuration.scm