;; This is an operating system configuration template ;; for a "desktop" setup with X11. (use-modules (gnu) (gnu system nss) (guix gexp) (guix packages) (guix download) (guix git-download) (guix build-system trivial) ((guix licenses) #:prefix license:) (gnu packages linux) (srfi srfi-1)) (use-service-modules desktop databases xorg ssh cups pm networking) (use-package-modules xfce certs pulseaudio databases linux xdisorg gnome guile-wm lisp ssh rsync cups admin scanner ghostscript) (define ssh-service (service openssh-service-type (openssh-configuration (password-authentication? #f)))) (define cups-service (service cups-service-type (cups-configuration (web-interface? #t) (extensions (list cups-filters hplip))))) #;(define thermald-service (service thermald-service-type (thermald-configuration (ignore-cpuid-check? #t)))) (define %scanner-udev-rule (udev-rule "90-scanner.rules" (string-append "ATTRS{idVendor}==\"04a9\", ATTRS{idProduct}==\"220e\", " "MODE=\"0664\", GROUP=\"scanner\", ENV{libsane_matched}=\"yes\""))) ;;; Borrowed from https://ambrevar.xyz/guix-advance/index.html (define-public linux-nonfree (package (inherit linux-libre) (name "linux-nonfree") (version (package-version linux-libre)) (source (origin (method url-fetch) (uri (string-append "https://www.kernel.org/pub/linux/kernel/v4.x/" "linux-" version ".tar.xz")) (sha256 (base32 "0sc60xj10r4pmlxisc57fy4f5pr7wgkgc96qc46cyj656fcbhjgb")))) #;(native-inputs `(("kconfig" ,(local-file "./linux-custom.conf")) ,@(alist-delete "kconfig" (package-native-inputs linux-libre)))))) (define (linux-firmware-version) "9d40a17beaf271e6ad47a5e714a296100eef4692") (define (linux-firmware-source version) (origin (method git-fetch) (uri (git-reference (url (string-append "https://git.kernel.org/pub/scm/linux/kernel" "/git/firmware/linux-firmware.git")) (commit version))) (file-name (string-append "linux-firmware-" version "-checkout")) (sha256 (base32 "099kll2n1zvps5qawnbm6c75khgn81j8ns0widiw0lnwm8s9q6ch")))) (define-public linux-firmware-iwlwifi (package (name "linux-firmware-iwlwifi") (version (linux-firmware-version)) (source (linux-firmware-source version)) (build-system trivial-build-system) (arguments `(#:modules ((guix build utils)) #:builder (begin (use-modules (guix build utils)) (let ((source (assoc-ref %build-inputs "source")) (fw-dir (string-append %output "/lib/firmware/"))) (mkdir-p fw-dir) (for-each (lambda (file) (copy-file file (string-append fw-dir (basename file)))) (find-files source "iwlwifi-.*\\.ucode$|LICENSE\\.iwlwifi_firmware$")) #t)))) (home-page "https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi") (synopsis "Non-free firmware for Intel wifi chips") (description "Non-free iwlwifi firmware") (license (license:non-copyleft "https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/tree/LICENCE.iwlwifi_firmware?id=HEAD")))) (operating-system (host-name "jasmine") (timezone "America/New_York") (locale "en_US.UTF-8") ;; for nonfree wifi driver ;; (kernel linux-nonfree) ;; Assuming /dev/sdX is the target hard disk, and "root" is ;; the label of the target root file system. (bootloader (grub-configuration (target "/dev/sda"))) (mapped-devices (list (mapped-device ;; TODO: switch to the uuid? (source "/dev/sda2") (target "guix-root") (type luks-device-mapping)))) (file-systems `(,(file-system (device "/dev/mapper/guix-root") (mount-point "/") (type "ext4")) ,@%base-file-systems)) (users (cons (user-account (name "cwebber") (uid 1000) (comment "Christopher Lemmer Webber") (group "cwebber") (supplementary-groups '("users" "wheel" "netdev" "audio" "video" "input" "scanner")) (home-directory "/home/cwebber")) %base-user-accounts)) (groups (cons* (user-group (name "cwebber") (id 1000)) (user-group (name "scanner")) %base-groups)) ;; Add Xfce and Ratpoison; that allows us to choose ;; sessions using either of these at the log-in screen. (packages (cons* xfce ;desktop environments sbcl-stumpwm gnome guile-wm nss-certs ;for HTTPS access pulseaudio postgresql xf86-input-wacom libwacom xscreensaver sane-backends simple-scan rsync hplip ;for cups and hp printers cups-filters gvfs ; mount camera, in theory? ;; gs-fonts ; this seems to come by default... maybe? ;; borg %base-packages)) ;; Use the "desktop" services, which include the X11 ;; log-in service, networking with Wicd, and more. (services (cons* ;;(postgresql-service) (screen-locker-service xscreensaver) ssh-service cups-service ;; thermald-service (extra-special-file "/usr/bin/env" (file-append coreutils "/bin/env")) (tor-service) (modify-services %desktop-services (udev-service-type config => (udev-configuration (inherit config) (rules (append (udev-configuration-rules config) (list %scanner-udev-rule)))))) ;; (modify-services %desktop-services ;; (slim-service-type ;; config => (slim-configuration ;; (inherit config) ;; (startx (xorg-start-command ;; #:configuration-file ;; (xorg-configuration-file ;; #:drivers '("intel"))))))) )) ;; Allow resolution of '.local' host names with mDNS. #;(name-service-switch %mdns-host-lookup-nss))