Installation guide


Pre-installation

Verify signature

Boot the live environment

Set the keyboard layout

To set the keyboard layout:

$ loadkeys dvorak

To list available keyboard layouts, refer to /run/current-system/profile/share/keymaps or run man loadkeys. By default, the installation uses US qwerty.

Connect to the Internet

Find available network interfaces:

$ ifconfig -a

Wired Network

To configure a wired network run the following command, substituting interface with the name of the wired interface you want to use:

$ ifconfig interface up

Wireless Network

To configure wireless networking, create a configuration file for the wpa_supplicant configuration tool:

$ nano wpa_supplicant.conf

with the following content, substituting your network details:

network={
  ssid="my-ssid"
  key_mgmt=WPA-PSK
  psk="the network's secret passphrase"
}

To start the wireless service, and run it on interface in the background:

$ wpa_supplicant -c wpa_supplicant.conf -i interface -B

Get IP

To get a new IP for your interface:

$ dhclient -v interface

SSH access

If you want to continue with the installation remotely, load the SSH server and set a root password:

$ herd start ssh-daemon
$ passwd

Partition the disks

First we'll need to create at least one partition:

$ cfdisk

For a very basic set-up, go with

  • dos
  • new
  • keep size
  • primary
  • write - yes
  • quit

Format the partitions

To format the new partition, use:

$ mkfs.ext4 -L my-root /dev/sda1

swap space

If you've also created a swap partition sda2, format and enable it now:

$ mkswap /dev/sda2
$ swapon /dev/sda2

Alternatively, you may create a swap file:

$ dd if=/dev/zero of=/mnt/swapfile bs=1MiB count=10240
# For security, we allow only root to read / write the swap file
$ chmod 600 /mnt/swapfile
$ mkswap /mnt/swapfile
$ swapon /mnt/swapfile

Mount the file systems

$ mount LABEL=my-root /mnt

Installation

herd start cow-store /mnt

Configure the system

$ mkdir /mnt/etc
# System configuration examples are below
$ nano /mnt/etc/system-config.scm

Once you're satisfied with your configuration, proceed with the installation:

$ guix system init /mnt/etc/system-config.scm /mnt

System configuration

Bare bones example
;; This is an operating system configuration template
;; for a "bare bones" setup, with no X11 display server.
;; read more at https://www.gnu.org/software/guix/manual/en/guix.html#Using-the-Configuration-System

(use-modules (gnu))
(use-service-modules networking ssh)
(use-package-modules screen)

(operating-system
  (host-name "panther")
  (timezone "Europe/Berlin")
  (locale "en_US.utf8")

  ;; Boot in "legacy" BIOS mode, assuming /dev/sda is the
  ;; target hard disk, and "my-root" is the label of the target
  ;; root file system.
  (bootloader (bootloader-configuration
                (bootloader grub-bootloader)
                (target "/dev/sda")))
  (file-systems (cons (file-system
                        (device (file-system-label "my-root"))
                        (mount-point "/")
                        (type "ext4"))
                      %base-file-systems))

  ;; This is where user accounts are specified.  The "root"
  ;; account is implicit, and is initially created with the
  ;; empty password.
  (users (cons (user-account
                (name "your-name")
                (comment "your-name's account")
                (group "users")

                ;; Adding the account to the "wheel" group
                ;; makes it a sudoer.  Adding it to "audio"
                ;; and "video" allows the user to play sound
                ;; and access the webcam.
                (supplementary-groups '("wheel"
                                        "audio" "video"))
                (home-directory "/home/your-name"))
               %base-user-accounts))

  ;; Globally-installed packages.
  (packages (cons screen %base-packages))

  ;; Add services to the baseline: a DHCP client and
  ;; an SSH server.
  (services (cons* (service dhcp-client-service-type)
                   (service openssh-service-type
                            (openssh-configuration
                              (port-number 2222)))
                   %base-services)))
GNOME example
;; This is an operating system configuration template
;; for a "desktop" setup with GNOME
;; read more at https://www.gnu.org/software/guix/manual/en/guix.html#Using-the-Configuration-System

(use-modules (gnu) (gnu system nss))
(use-service-modules desktop)
(use-package-modules certs gnome)

(operating-system
  (host-name "panther")
  (timezone "Europe/Berlin")
  (locale "en_US.utf8")

  ;; Boot in "legacy" BIOS mode, assuming /dev/sda is the
  ;; target hard disk, and "my-root" is the label of the target
  ;; root file system.
  (bootloader (bootloader-configuration
               (bootloader grub-bootloader)
               (target "/dev/sda")))
  (file-systems (cons (file-system
                        (device (file-system-label "my-root"))
                        (mount-point "/")
                        (type "ext4"))
                 %base-file-systems))

  ;; This is where user accounts are specified.  The "root"
  ;; account is implicit, and is initially created with the
  ;; empty password.
  (users (cons (user-account
                (name "your-name")
                (comment "your-name's account")
                (group "users")
                (supplementary-groups '("wheel" "netdev"
                                        "audio" "video"))
                (home-directory "/home/your-name"))
               %base-user-accounts))

  ;; This is where we specify system-wide packages.
  (packages (cons* nss-certs         ;for HTTPS access
                   gvfs              ;for user mounts
                   %base-packages))

  ;; Add GNOME - we can choose at the log-in
  ;; screen with F1.  Use the "desktop" services, which
  ;; include the X11 log-in service, networking with
  ;; NetworkManager, and more.
  (services (cons* (gnome-desktop-service)
                   %desktop-services)))
Xfce example
;; This is an operating system configuration template
;; for a "desktop" setup with Xfce
;; read more at https://www.gnu.org/software/guix/manual/en/guix.html#Using-the-Configuration-System

(use-modules (gnu) (gnu system nss))
(use-service-modules desktop)
(use-package-modules certs)

(operating-system
  (host-name "panther")
  (timezone "Europe/Berlin")
  (locale "en_US.utf8")

  ;; Boot in "legacy" BIOS mode, assuming /dev/sda is the
  ;; target hard disk, and "my-root" is the label of the target
  ;; root file system.
  (bootloader (bootloader-configuration
               (bootloader grub-bootloader)
               (target "/dev/sda")))
  (file-systems (cons (file-system
                        (device (file-system-label "my-root"))
                        (mount-point "/")
                        (type "ext4"))
                 %base-file-systems))

  ;; This is where user accounts are specified.  The "root"
  ;; account is implicit, and is initially created with the
  ;; empty password.
  (users (cons (user-account
                (name "your-name")
                (comment "your-name's account")
                (group "users")
                (supplementary-groups '("wheel" "netdev"
                                        "audio" "video"))
                (home-directory "/home/your-name"))
               %base-user-accounts))

  ;; This is where we specify system-wide packages.
  (packages (cons* nss-certs         ;for HTTPS access
                   gvfs              ;for user mounts
                   %base-packages))

  ;; Add Xfce - we can choose at the log-in
  ;; screen with F1.  Use the "desktop" services, which
  ;; include the X11 log-in service, networking with
  ;; NetworkManager, and more.
  (services (cons* (xfce-desktop-service)
                   %desktop-services)))

Read more about System Configuration and discover countless of other examples.

Reboot

After completion, you may boot into your new system with reboot.

Post-installation

To proceed, it's best you login with root.

Root password

Set the root password with:

$ passwd

User password

Set the username password with:

$ passwd username

Update the system

It's good practice to update the system now:

$ guix pull

This will download the latest package definitions, and update guix itself. To apply the update, do:

$ guix system reconfigure /etc/system-config.scm

Once that has completed, restart your system:

$ reboot

After rebooting, you can list your system generations with:

$ guix system list-generations

After a fresh installation, and first update, you should see 2 generations, similar to this:

Generation 1    Dec 07 2018 23:20:14
  file name: /var/guix/profiles/system-1-link
  canonical file name: /gnu/store/sfk9hvzlxppgbkp1rql1d9r7gv3zrj4a-system
  label: GNU with Linux-Libre 4.19.6 (beta)
  bootloader: grub
  root device: label: "my-root"
  kernel: /gnu/store/0zajbn9q39yva4l0zzrcshlll8qikzba-linux-libre-4.19.6/bzImage
Generation 2    Dec 08 2018 11:36:15
  file name: /var/guix/profiles/system-2-link
  canonical file name: /gnu/store/5q7i7wg2smfyfkzdkgi0na2xl8c6yz21-system
  label: GNU with Linux-Libre 4.19.6 (beta)
  bootloader: grub
  root device: label: "my-root"
  kernel: /gnu/store/0zajbn9q39yva4l0zzrcshlll8qikzba-linux-libre-4.19.6/bzImage

Every time you make a change to your system configuration, with guix system reconfigure ..., a new system generation will be initiated. If anything ever goes wrong, you can roll-back to a previous generation 1 with:

$ guix system switch-generation 1

This switch is also available trough grub, so you can roll-back, without command line access.

PantherX & (unofficial) GuixSD Wiki.

Last update: 2019-10-13 10:07:20 +0000

Inspired by the excellent Arch Linux Wiki