Basic (U)EFI Partition Layout and Creation Process:
If you want a swap partition, format and partition disks like this:
sudo parted /dev/sda --script \
mklabel gpt \
mkpart primary linux-swap 1MiB 4096MiB \
name 1 guix-swap \
mkpart ESP fat32 4096MiB 6144MiB \
name 2 guix-efi \
set 2 esp on \
mkpart primary ext4 6144MiB 100% \
name 3 guix-root
sudo mkswap -L guix-swap /dev/sda1
sudo swapon /dev/sda1
sudo mkfs.fat -F32 -n guix-efi /dev/sda2
sudo mkfs.ext4 -L guix-root /dev/sda3
sudo mount /dev/sda3 /mnt
sudo mkdir -p /mnt/boot/efi
sudo mount /dev/sda2 /mnt/boot/efiOtherwise, partition like this:
sudo parted /dev/sda --script \
mklabel gpt \
mkpart ESP fat32 1MiB 2048MiB \
name 1 guix-efi \
set 1 esp on \
mkpart primary ext4 2048MiB 100% \
name 2 guix-root
sudo mkfs.fat -F32 -n guix-efi /dev/sda1
sudo mkfs.ext4 -L guix-root /dev/sda2
sudo mount /dev/sda2 /mnt
sudo mkdir -p /mnt/boot/efi
sudo mount /dev/sda1 /mnt/boot/efi(bootloader (bootloader-configuration
(bootloader grub-efi-bootloader)
(targets '("/boot/efi"))
(keyboard-layout keyboard-layout)))
(file-systems (cons* (file-system
(device (file-system-label "guix-root"))
(mount-point "/")
(type "ext4"))
(file-system
(device (file-system-label "guix-efi"))
(mount-point "/boot/efi")
(type "vfat"))
%base-file-systems))
;; If you enabled Swap, add this:
(swap-devices (list
(swap-space
(target (file-system-label "guix-swap")))))
Basic Legacy/BIOS Partition Layout anc Creation Process:
sudo parted /dev/sda --script \
mklabel msdos \
mkpart primary ext4 1MiB 100% \
set 1 boot on
sudo mkfs.ext4 -L guix-root /dev/sda1
sudo mount /dev/sda1 /mntIf you want a swap partition, do this instead:
sudo parted /dev/sda --script \
mklabel msdos \
mkpart primary linux-swap 1MiB 4096MiB \
mkpart primary ext4 4096MiB 100% \
set 2 boot on
sudo mkswap -L guix-swap /dev/sda1
sudo swapon /dev/sda1
sudo mkfs.ext4 -L guix-root /dev/sda2
sudo mount /dev/sda2 /mnt(bootloader (bootloader-configuration
(bootloader grub-bootloader)
(keyboard-layout keyboard-layout)
(targets '("/dev/sdb")))) ; or other '/dev/sdX'-drive with root partition.
(file-systems (cons* (file-system
(mount-point "/")
(device (file-system-label "guix-root"))
(type "ext4")) %base-file-systems))
;; If you enabled Swap, add this:
(swap-devices (list
(swap-space
(target (file-system-label "guix-swap")))))
To initialize the Guix System, run `guix system init /path/to/config.scm /mnt`, e.g.:
mkdir -p /mnt/etc/guix
mv /path/to/geex/* /mnt/etc/guix/
herd start cow-store /mnt
guix system init /mnt/etc/guix/config.scm /mntThe command `herd start cow-store /mnt` initializes a copy-on-write /gnu/store inside /mnt, so that the downloaded and installed packages, derivations, and files, get installed to /mnt/gnu/store, and not into RAM or any other temporary/live /gnu/store.
Set passwords for users inside the “/mnt”-mounted GNU+Linux install.
passwd -R /mnt root
passwd -R /mnt puppyAuthorize channel keys via ‘sudo guix archive –authorize < /etc/guix/files/keys/nonguix.pub’.
guix shell git-minimal
git clone https://github.com/librepup/geex.git
mkdir -p /mnt/geex
mkdir -p ~/.config/guix
cp ./geex/channels.scm ~/.config/guix/channels.scm
guix archive --authorize < ./geex/files/keys/nonguix.pub
; Optional, define channels file: 'guix pull --channels=/path/to/channels.scm'
guix pullFind WiFi Device/Cards Name via ‘ifconfig -a’.
sudo ip link set interface1s0 up
sudo rfkill unblock wifi
rfkill unblock all
wpa_supplicant -c wifi.conf -i interface1s0 -B
dhclient -v interface1s0
nmcli device wifi list
nmcli device wifi connect "SSID" password "PASSWORD"Then check ip address assignment via ‘ip addr show interface1s0’, and check the routing table with ‘ip route show’. If the routing got set up correctly, a line starting with “default via …” should appear.
network={
ssid="ssid-name"
key_mgmt=WPA-PSK
psk="password"
}Or for an open network:
network={
ssid="ssid-name"
key_mgmt=NONE
priority=1
}To update the Guix Channels and pull the latest Guix and Channel Versions, run `guix pull`. Then, to rebuild your system, run `sudo guix system reconfigure /path/to/config.scm`. After running `guix pull`, remember to run `hash guix` to update bash’s cache and clear it of the old guix binary location. Also make sure that “~/.config/guix/channels.scm” or “/etc/guix/channels.scm” is the first item in your $PATH.
guix system list-generationsguix system describesudo guix system delete-generations 1msudo guix system roll-backDelete Generations older than 1 Month, and try to free up at least 10GiB.
guix gc -d 1m -F 10Gguix gc --optimizeguix home reconfigure /path/to/home.scmguix describeguix upgradeThis can help to find syntax errors, such as misplaced brackets, easier.
guix style -f config.scmguix package --list-installedguix installguix removeguix package --delete-generationssudo herd start namesudo herd stop namesudo herd restart namesudo herd status namesudo herd status- `guix gc`
- `sudo guix system delete-generations 1d`
- `guix package –delete-generations`
- `guix pull`
- `sudo systemctl restart guix-daemon.service` or `sudo herd restart guix-daemon`
(simple-service 'emacs-daemon shepherd-root-service-type
(list (shepherd-service (documentation "Emacs Daemon")
(provision '(emacs-daemon))
(requirement '(user-processes))
(start #~(make-forkexec-constructor
(list #+(file-append
emacs-pgtk
"/bin/emacs")
"--fg-daemon")
#:user "puppy"
#:group "users"
#:log-file
"/var/log/emacs-daemon.log"
#:environment-variables (list
(string-append
"HOME=/home/puppy")
"TERM=kitty")))
(stop #~(make-kill-destructor))
(respawn? #t))))
(simple-service 'null-audio boot-service-type
(list (shepherd-service (documentation "Null Out Audio")
(provision '(audio-null-out))
(requirement '(alsa))
(start #~(make-forkexec-constructor
(list #+(file-append
alsa-utils
"/bin/amixer")
"set" "Master"
"0%")))
(stop #~(make-kill-destructor)))))
(simple-service 'mute-audio boot-service-type
(list (shepherd-service (documentation "Mute Audio")
(provision '(audio-mute))
(requirement '(alsa))
(start #~(make-forkexec-constructor
(list #+(file-append
alsa-utils
"/bin/amixer")
"set" "Master"
"mute")))
(stop #~(make-kill-destructor)))))
Use this to pin nonguix & guix channel to linux kernel 6.18.7 commit, so that not every rebuild, rebuilds the entire kernel.
(operating-system
(kernel (let*
((channels
(list (channel
(name 'nonguix)
(url "https://gitlab.com/nonguix/nonguix")
(commit "6c0ea215e0bd089bf3b2097e5c59dd726fbbe3045"))
(channel
(name 'guix)
(url "https://git.guix.gnu.org/guix.git")
(commit "9e6705676ffb7568d03b2b6c9fa3944afa2341e7"))))
(inferior
(inferior-for-channels channels)))
(first (lookup-inferior-packages inferior "linux" "6.18.7"))))
)(append (list
(channel
(name 'pantherx)
(url "https://codeberg.org/gofranz/panther.git")
(introduction
(make-channel-introduction
"54b4056ac571611892c743b65f4c47dc298c49da"
(openpgp-fingerprint
"A36A D41E ECC7 A871 1003 5D24 524F EB1A 9D33 C9CB")))))
%default-channels)
The Alsa Service is already included in “%desktop-services”, so no need to manually add it.
(service alsa-service-type)
(bootloader (bootloader-configuration
(keyboard-layout keyboard-layout)
(bootloader grub-bootloader)
(targets '("/dev/sda"))))(bootloader (bootloader-configuration
(keyboard-layout keyboard-layout)
(bootloader grub-efi-bootloader)
(targets '("/boot/efi"))))Create the root (/) partition with label “guix-root”, and the boot partition (if present) with label “guix-efi” or “guix-boot”. Labels can be attached afterwards via ‘sudo e2label /dev/sda1 guix-root’ or ‘sudo tune2fs -L guix-root /dev/sda1’.
(file-systems (append
(list (file-system
(device "/dev/mapper/cryptroot")
(mount-point "/")
(type "ext4")
(dependencies mapped-devices))
(file-system
(device (file-system-label "guix-efi"))
; or: (device (uuid "boot-partition-uuid" 'fat32))
(mount-point "/boot/efi")
(type "vfat")))
%base-file-systems))(file-systems (cons* (file-system
(mount-point "/")
(device (file-system-label "guix-root"))
(type "ext4"))
(file-system
(mount-point "/boot/efi")
(device (file-system-label "guix-efi"))
; or:
; (device (uuid "PartitionUUID"))
; optional:
; (device (uuid "PartitionUUID" 'fat32))
(type "vfat"))
%base-file-systems))(file-systems (cons* (file-system
(mount-point "/")
(device (file-system-label "guix-root"))
(type "ext4"))
%base-file-systems))See Nonguix Documentation (https://gitlab.com/nonguix/nonguix), Section: NVIDIA Graphics Card -> System Setup.
((nonguix-transformation-nvidia #:configure-xorg? #t)
%guix-os)((compose (nonguix-transformation-nvidia))
%guix-os)(modify-services %desktop-services
(delete pulseaudio-service-type)
)(services
(append
(list
(set-xorg-configuration
(xorg-configuration
(keyboard-layout keyboard-layout)
(modules (cons nvidia-driver %default-xorg-modules))
(drivers '("nvidia"))))
)
)
)To specify the channel a package should be pulled from, define the name like so:
(use-modules (jonabron packages emacs) #:rename (emacs-fancy-dabbrev jonabron-emacs-fancy-dabbrev))
(use-modules (emacs packages melpa) #:rename (emacs-fancy-dabbrev melpa-emacs-fancy-dabbrev))And then add the renamed package to the packages list:
(home-environment
(packages (specifications->packages
(list "jonabron-emacs-fancy-dabbrev") ; or: "melpa-emacs-fancy-dabbrev"
))
)(services
(append
(list
(service hurd-vm-service-type
(hurd-vm-configuration
(memory-size 2048)
(secret-directory "/etc/guix/hurd-secrets")))
)
)
)Enter Hurd via `ssh -p 2222 root@localhost`. (+`-X` for X11 passthrough)
Copy files to Hurd via `scp -P 2222 <file> root@localhost:~/`, and similarly, from Hurd, via `scp -P 2222 root@localhost:/hurd/path/to/file ./`.
Generate SSH Key via `ssh-keygen -t ed25519`, spam enter to not set a passphrase and use the default settings, then copy the `~/.ssh/id_XXXXXXX.pub` key into `/etc/guix/hurd-secrets` before rebuilding the system.
`herd status hurd-vm`
`herd stop hurd-vm`
`herd start hurd-vm`
In case X11/Xorg forwarding via SSH does not work, it may be advised to set an option such as `xhost +local:root`.