]> git.ekhem.eu.org Git - guix.git/commitdiff
[home][system] Introduce a nonfree configuration.
authorJakub Czajka <jakub@ekhem.eu.org>
Sat, 20 Jun 2026 20:17:47 +0000 (22:17 +0200)
committerJakub Czajka <jakub@ekhem.eu.org>
Wed, 24 Jun 2026 22:53:14 +0000 (00:53 +0200)
Pull nonguix guix channel. Select configuration through $PROFILE.

Makefile
README
conf/home/guix.scm [new file with mode: 0644]
conf/system/desktop.scm
guix/.config/guix/channels.scm [new file with mode: 0644]
home.scm
system.scm

index b1660d2187819a13106528a247e7321ca998e3b3..f1136d0bb705205d17fecd0d41bdf83ff121efe0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,12 +5,19 @@ guix-profile := ~/.guix-home/profile
 guix-store := /gnu/store
 guix-version := $(shell guix show guix | sed -n '/^version/s/^.*: //gp')
 
-home:
-       GUIX_PACKAGE_PATH=`pwd` guix home reconfigure home.scm
+home-nonfree:
+       GUIX_PACKAGE_PATH=`pwd` PROFILE=nonfree guix home reconfigure home.scm
        . $(guix-profile)/etc/profile
 
-system:
-       sudo GUIX_PACKAGE_PATH=`pwd` guix system reconfigure system.scm
+home-libre:
+       GUIX_PACKAGE_PATH=`pwd` PROFILE=libre guix home reconfigure home.scm
+       . $(guix-profile)/etc/profile
+
+system-nonfree:
+       sudo GUIX_PACKAGE_PATH=`pwd` PROFILE=nonfree guix system reconfigure system.scm
+
+system-libre:
+       sudo GUIX_PACKAGE_PATH=`pwd` PROFILE=libre guix system reconfigure system.scm
 
 tags:
        find $(guix-store) -wholename "*guix-$(guix-version)*.scm" -or \
diff --git a/README b/README
index 0a911a7cea879919674c4a7510dbf3948fa6644e..db3d3f88c9c3ffd7be66eff5d3fb3c05e9bd83bc 100644 (file)
--- a/README
+++ b/README
@@ -5,6 +5,18 @@ System and home directory configuration for the GNU Guix operating system. It
 installs programs and their configuration files (dotfiles). See Makefile for
 installation instructions.
 
+Bootstrap
+---------
+
+guix/.config/guix/channels.scm declares third-party channels needed to build the
+configuration (e.g., nonguix). Before the first guix pull, copy it into place:
+
+$ mkdir --parents ~/.config/guix
+$ cp guix/.config/guix/channels.scm ~/.config/guix/channels.scm
+$ guix pull
+
+After fetching channels, guix home reconfigure takes over managing the file.
+
 Files
 -----
 
diff --git a/conf/home/guix.scm b/conf/home/guix.scm
new file mode 100644 (file)
index 0000000..6f858d1
--- /dev/null
@@ -0,0 +1,13 @@
+;; Copyright (c) 2026 Jakub Czajka <jakub@ekhem.eu.org>
+;; License: GPL-3.0 or later.
+;;
+;; guix.scm - configuration for GNU Guix.
+
+(define-module (conf home guix)
+  #:use-module (conf home symlink)
+  #:use-module (gnu home services)
+  #:export (channels-service))
+
+(define channels-service
+  (service home-symlink-service-type
+           (list "guix/.config/guix/channels.scm")))
index 626982ba4d728e1c3896f421ecf5ce33159b514b..3e0e9289e79c1abe8276c0b7a9be3a01f0ef1bcb 100644 (file)
@@ -8,12 +8,17 @@
   #:use-module (conf common suckless)
   #:use-module (gnu packages fonts)
   #:use-module (gnu packages suckless)
+  #:use-module (gnu services)
+  #:use-module (gnu services desktop)
+  #:use-module (gnu services networking)
   #:use-module (gnu services xorg)
   #:use-module (gnu system keyboard)
+  #:use-module (guix gexp)
   #:use-module (guix git-download)
   #:use-module (guix packages)
-  #:export (dwm-desktop-packages
-           keyboard-layout-service))
+  #:export (dwm-desktop-packages %custom-desktop-services
+                                 %gdm-wayland-disabled %resolv-conf-service
+                                 keyboard-layout-service))
 
 (define dmenu-libxft-bgra
   (package
    (xorg-configuration
     (keyboard-layout
      (keyboard-layout "pl")))))
+(define %gdm-wayland-disabled
+  (gdm-configuration (inherit (gdm-configuration))
+                     (wayland? #f)))
+
+(define %network-manager-encrypted-dns
+  (let* ((dns-tls-file (plain-file "90-dns-over-tcp.conf"
+                                   "[connection]\nconnection.dns-over-tls=2\n"))
+         (dns-tls-config `(("90-dns-over-tcp.conf" ,dns-tls-file))))
+    (network-manager-configuration (inherit (network-manager-configuration))
+                                   (dns "none")
+                                   (extra-configuration-files dns-tls-config))))
+
+(define %resolv-conf-service
+  (let* ((guix-path (getenv "GUIX_PACKAGE_PATH"))
+         (resolv-conf (local-file (string-append guix-path
+                                                 "/dns/etc/resolv.conf")))
+         (etc-files (list `("resolv.conf" ,resolv-conf))))
+    (simple-service 'resolv etc-service-type etc-files)))
+
+(define %custom-desktop-services
+  (modify-services %desktop-services
+    (gdm-service-type config => %gdm-wayland-disabled)
+    (network-manager-service-type config => %network-manager-encrypted-dns)))
 
 (define dwm-desktop-packages
   (list dmenu-libxft-bgra
diff --git a/guix/.config/guix/channels.scm b/guix/.config/guix/channels.scm
new file mode 100644 (file)
index 0000000..53dffd0
--- /dev/null
@@ -0,0 +1,10 @@
+(cons* (channel
+        (name 'nonguix)
+        (url "https://gitlab.com/nonguix/nonguix")
+        (branch "master")
+        (introduction
+          (make-channel-introduction
+            "897c1a470da759236cc11798f4e0a5f7d4d59fbc"
+            (openpgp-fingerprint
+             "2A39 3FFF 68F4 EF7A 3D29  12AF 6F51 20A0 22FB B2D5"))))
+       %default-channels)
index 14eb8cd6233b27cfd66ca934c62b938a63c3c7bd..8cedf9096a458c40bc46e939d6a28487851dbb2f 100644 (file)
--- a/home.scm
+++ b/home.scm
@@ -1,26 +1,36 @@
-;; Copyright (c) 2022-2024 Jakub Czajka <jakub@ekhem.eu.org>
+;; Copyright (c) 2022-2026 Jakub Czajka <jakub@ekhem.eu.org>
 ;; License: GPL-3.0 or later.
 ;;
 ;; home.scm - home directory configuration for GNU Guix.
+;;
+;; Set PROFILE to select free-software stance:
+;;   PROFILE=nonfree -- allows non-free software.
+;;   PROFILE=libre   -- free software only.
 
-(use-modules (conf home bash)
-            (conf home emoji)
-            (conf home desktop)
-            (conf home emacs)
-            (conf home notify)
-            (conf home suckless)
-            (gnu packages gnuzilla))
+(use-modules (gnu home)
+             (conf home bash)
+             (conf home emoji)
+             (conf home desktop)
+             (conf home emacs)
+             (conf home guix)
+             (conf home notify)
+             (conf home suckless)
+             (gnu packages gnuzilla)
+             (nongnu packages mozilla))
 
-(home-environment
- (packages
-  (list icecat-minimal
-        select-emoji
-       st-libxft-bgra))
- (services
-  (append
-   (list autorandr-service
-        notify-service
-         screenshot-service)
-   bash-services
-   desktop-services
-   emacs-services)))
+(let ((profile (string->symbol (or (getenv "PROFILE") "nonfree"))))
+  (home-environment
+    (packages (case profile
+                ((nonfree)
+                 (list firefox select-emoji st-libxft-bgra))
+                ((libre)
+                 (list icecat-minimal select-emoji st-libxft-bgra))))
+    (services
+     (case profile
+       ((nonfree)
+        (append (list autorandr-service channels-service notify-service
+                      screenshot-service) bash-services desktop-services
+                emacs-services))
+       ((libre)
+        (append (list autorandr-service notify-service screenshot-service)
+                bash-services desktop-services emacs-services))))))
index d17f8d2292402c2890b048871e447fe14ab36e81..c25220d1e917f9d2098e97e2b3907335e5dc5c75 100644 (file)
-;; Copyright (c) 2022-2025 Jakub Czajka <jakub@ekhem.eu.org>
+;; Copyright (c) 2022-2026 Jakub Czajka <jakub@ekhem.eu.org>
 ;; License: GPL-3.0 or later.
 ;;
 ;; system.scm - system configuration for GNU Guix.
+;;
+;; Set PROFILE to select free-software stance:
+;;   PROFILE=nonfree — allows non-free firmware.
+;;   PROFILE=libre   — free software only.
 
 (use-modules (conf system bluetooth)
              (conf system desktop)
              (conf system volume)
              (gnu)
-             (gnu services networking)
-             (gnu services xorg)
+             (gnu system)
              (gnu system nss))
 
-(use-package-modules base
-                     certs
-                     linux
-                     pulseaudio
-                     xdisorg)
+(use-package-modules base certs linux pulseaudio xdisorg)
 
-(use-service-modules desktop)
+(use-service-modules desktop networking xorg)
 
 (use-system-modules setuid)
 
-(define etc-files
-  (list `("resolv.conf"
-          ,(local-file
-            (string-concatenate
-             (list (getenv "GUIX_PACKAGE_PATH")
-                   "/dns/etc/resolv.conf"))))))
-
-(operating-system
- (kernel linux-libre)
- (keyboard-layout
-  (keyboard-layout "us"))
- (bootloader
-  (bootloader-configuration
-   (bootloader
-    (bootloader
-     (inherit grub-bootloader)
-     (installer #~(const #t))))
-   (keyboard-layout keyboard-layout)))
- (host-name "machine")
- (mapped-devices
-  (list (mapped-device
-         (source
-          (uuid "565d174f-3d96-45a1-8bef-fdab38e4d35a"))
-         (target "fde")
-         (type luks-device-mapping))
-        (mapped-device
-         (source "matrix")
-         (targets
-          (list "matrix-rootvol" "matrix-swapvol"))
-         (type lvm-device-mapping))))
- (file-systems
-  (append
-   (list (file-system
-          (type "ext4")
-          (mount-point "/")
-          (device (file-system-label "root"))
-          (flags '(no-atime))
-          (needed-for-boot? #t)
-          (dependencies mapped-devices)))
-   %base-file-systems))
- (swap-devices
-  (list (file-system-label "swap")))
- (users
-  (append
-   (list (user-account
-          (name "dak")
-          (group "users")
-          (supplementary-groups
-           (list "audio" "cdrom" "lp" "netdev" "tape" "video" "wheel"))))
-   %base-user-accounts))
- (packages
-  (append
-   (list gnu-make
-         bluez
-         pulseaudio
-         volume)
-   dwm-desktop-packages
-   %base-packages))
- (timezone "Europe/Warsaw")
- (locale "en_US.UTF-8")
- (name-service-switch %mdns-host-lookup-nss)
- (setuid-programs
-  (cons*
-   (setuid-program
-    (program (file-append xsecurelock "/libexec/xsecurelock/authproto_pam")))
-   %setuid-programs))
- (services
-  (append
-   (list bluez-service
-         (simple-service 'resolv
-                         etc-service-type
-                         etc-files)
-         keyboard-layout-service)
-   (modify-services %desktop-services
-    (gdm-service-type config =>
-     (gdm-configuration
-      (inherit config)
-      (wayland? #f)))
-    (network-manager-service-type config =>
-     (network-manager-configuration
-      (inherit config)
-      (dns "none")
-      (extra-configuration-files
-       `(("90-dns-over-tcp.conf" ,(plain-file "90-dns-over-tcp.conf"
-                                            "\
-[connection]
-connection.dns-over-tls=2\n"))))))))))
+(use-modules (nongnu packages linux)
+             (nongnu system linux-initrd))
+(use-modules (gnu system linux-initrd))
+
+(let ((profile (string->symbol (or (getenv "PROFILE") "nonfree"))))
+  (operating-system
+    (initrd (case profile
+              ((nonfree)
+               microcode-initrd)
+              ((libre)
+               base-initrd)))
+
+    (kernel (case profile
+              ((nonfree)
+               linux)
+              ((libre)
+               linux-libre)))
+
+    (firmware (case profile
+                ((nonfree)
+                 (list linux-firmware))
+                ((libre)
+                 '())))
+
+    (locale "en_US.UTF-8")
+    (timezone "Europe/Warsaw")
+
+    (keyboard-layout (keyboard-layout "us"))
+
+    (host-name "dak")
+    (users (append (list (user-account
+                           (name "dak")
+                           (group "users")
+                           (supplementary-groups '("audio" "cdrom"
+                                                   "lp"
+                                                   "netdev"
+                                                   "tape"
+                                                   "video"
+                                                   "wheel"))))
+                   %base-user-accounts))
+
+    (bootloader (case profile
+                  ((nonfree)
+                   (bootloader-configuration
+                     (bootloader grub-efi-bootloader)
+                     (targets '("/boot/efi"))
+                     (keyboard-layout keyboard-layout)))
+                  ((libre)
+                   (bootloader-configuration
+                     (bootloader (bootloader (inherit grub-bootloader)
+                                             (installer #~(const #t))))
+                     (keyboard-layout keyboard-layout)))))
+
+    (mapped-devices (case profile
+                      ((nonfree)
+                       (list (mapped-device
+                               (source (uuid
+                                        "b8be09cf-d416-4a49-ab69-173ee227acb6"))
+                               (target "root")
+                               (type luks-device-mapping))))
+                      ((libre)
+                       (list (mapped-device
+                               (source (uuid
+                                        "565d174f-3d96-45a1-8bef-fdab38e4d35a"))
+                               (target "root")
+                               (type luks-device-mapping))
+                             (mapped-device
+                               (source "matrix")
+                               (targets (list "matrix-rootvol"
+                                              "matrix-swapvol"))
+                               (type lvm-device-mapping))))))
+
+    (file-systems (append (case profile
+                            ((nonfree)
+                             (list (file-system
+                                     (type "ext4")
+                                     (mount-point "/")
+                                     (device (file-system-label "root"))
+                                     (dependencies mapped-devices))
+                                   (file-system
+                                     (type "vfat")
+                                     (mount-point "/boot/efi")
+                                     (device (file-system-label "EFI"))
+                                     (needed-for-boot? #t))))
+                            ((libre)
+                             (list (file-system
+                                     (type "ext4")
+                                     (mount-point "/")
+                                     (device (file-system-label "root"))
+                                     (flags '(no-atime))
+                                     (needed-for-boot? #t)
+                                     (dependencies mapped-devices)))))
+                          %base-file-systems))
+
+    (swap-devices (list (swap-space
+                          (target (file-system-label "swap"))
+                          (dependencies mapped-devices))))
+
+    (name-service-switch %mdns-host-lookup-nss)
+
+    (setuid-programs (let* ((xsecurelock-path
+                             "/libexec/xsecurelock/authproto_pam")
+                            (xsecurelock-auth (file-append xsecurelock
+                                                           xsecurelock-path)))
+                       (cons* (setuid-program (program xsecurelock-auth))
+                              %setuid-programs)))
+
+    (packages (append (list gnu-make bluez pulseaudio volume)
+                      dwm-desktop-packages %base-packages))
+
+    (services
+     (append (list bluez-service %resolv-conf-service keyboard-layout-service)
+             %custom-desktop-services))))