(define-module (systems mcdowell-old) #:use-module (users id1000)) (define host-name* "mcdowell") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define install-grub-mcdowell ((@ (guix gexp) gexp) (lambda (bootloader device mount-point) (let ((grub (string-append bootloader "/sbin/grub-install")) (install-dir (string-append mount-point "/boot"))) ;; Install GRUB on DEVICE which is mounted at MOUNT-POINT. If DEVICE ;; is #f, then we populate the disk-image rooted at MOUNT-POINT. (if device (begin ;; Tell 'grub-install' that there might be a LUKS-encrypted ;; /boot or root partition. (setenv "GRUB_ENABLE_CRYPTODISK" "y") ;; Hide potentially confusing messages from the user, such as ;; "Installing for i386-pc platform." (invoke/quiet grub "--no-floppy" "--target=x86_64-efi" "--removable" "--no-nvram" "--boot-directory" install-dir "--efi-directory" "/boot/efi") ;; (invoke/quiet grub ;; "--no-floppy" ;; "--target=i386-efi" ;; "--removable" ;; "--no-nvram" ;; "--boot-directory" ;; install-dir ;; "--efi-directory" ;; "/boot/efi") (invoke/quiet grub "--no-floppy" "--target=i386-pc" "--boot-directory" install-dir device)) ;; When creating a disk-image, only install a font and GRUB modules. (let* ((fonts (string-append install-dir "/grub/fonts"))) (mkdir-p fonts) (copy-file (string-append bootloader "/share/grub/unicode.pf2") (string-append fonts "/unicode.pf2")) (copy-recursively (string-append bootloader "/lib/") install-dir))))))) (define home-environments-mcdowell `((,uid1000-name ,(uid1000-home-environment host-name*)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define bootloader-target-mcdowell ((@ (machines amd64) bootloader-device-path) host-name*)) (define (desktop-services-mcdowell) (use-modules (suweren system)) %suweren-services) (define grub-custom-bootloader-mcdowell (let ((grub-mkrescue-bootloader (@ (gnu bootloader grub) grub-mkrescue-bootloader))) ((@ (gnu bootloader) bootloader) (inherit grub-mkrescue-bootloader) (installer install-grub-mcdowell)))) (define keyboard-layout-mcdowell ((@ (gnu system keyboard) keyboard-layout) "pl")) (define (guix-home-service-mcdowell) (use-modules (gnu services guix)) ((@ (gnu services) service) guix-home-service-type home-environments-mcdowell)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define bootloader-mcdowell ((@ (gnu bootloader) bootloader-configuration) (bootloader grub-custom-bootloader-mcdowell) (keyboard-layout keyboard-layout-mcdowell) (targets (list bootloader-target-mcdowell)))) (define (label-mcdowell operating-system) (let* ((operating-system-default-label (@ (gnu system) operating-system-default-label)) (default-label-string (operating-system-default-label operating-system))) (string-append host-name* ": " default-label-string))) (define services-mcdowell (append (desktop-services-mcdowell) (list (guix-home-service-mcdowell)))) (define users-mcdowell (list uid1000-account)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define-public operating-system* (let ((%base-groups (@ (gnu system shadow) %base-groups)) (%base-packages (@ (gnu system) %base-packages)) (%base-initrd-modules (@ (gnu system linux-initrd) %base-initrd-modules)) (%default-issue (@@ (gnu system) %default-issue)) (%default-kernel-arguments (@ (gnu system) %default-kernel-arguments)) (%default-locale-libcs (@ (gnu system locale) %default-locale-libcs)) (%default-nss (@ (gnu system nss) %default-nss)) (%default-privileged-programs (@ (gnu system) %default-privileged-programs)) (%setuid-programs (@ (gnu system) %setuid-programs)) (%sudoers-specification* (@ (suweren commons sudoers) %sudoers-specification*)) (%suweren-locale-definitions (@ (suweren system) %suweren-locale-definitions)) (base-pam-services ((@ (gnu system pam) base-pam-services))) (default-skeletons ((@ (gnu system shadow) default-skeletons))) (file-systems* (@ (machines amd64) file-systems*)) (firmware* (@ (machines amd64) firmware*)) (initrd* (@ (machines amd64) initrd*)) (kernel-amd64 (@ (machines amd64) kernel-amd64)) (location-mcdowell (and=> ((@ (guix utils) current-source-location)) (@ (guix utils) source-properties->location))) (operating-system-default-essential-services (@ (gnu system) operating-system-default-essential-services)) (polish-locale-string (@ (suweren system) polish-locale-string)) (swap-devices* (@ (machines amd64) swap-devices*))) ((@ (gnu system) operating-system) (kernel kernel-amd64) (kernel-loadable-modules (list)) (kernel-arguments %default-kernel-arguments) (hurd #f) (bootloader bootloader-mcdowell) (label (label-mcdowell (@ (gnu system) this-operating-system))) (keyboard-layout keyboard-layout-mcdowell) (initrd initrd*) (initrd-modules %base-initrd-modules) (firmware firmware*) (host-name host-name*) (mapped-devices (list)) (file-systems (file-systems* host-name*)) (swap-devices (swap-devices* host-name*)) (users users-mcdowell) (groups %base-groups) (skeletons default-skeletons) (issue %default-issue) (packages %base-packages) (timezone "Europe/Warsaw") (locale polish-locale-string) (locale-definitions %suweren-locale-definitions) (locale-libcs %default-locale-libcs) (name-service-switch %default-nss) (essential-services (operating-system-default-essential-services (@ (gnu system) this-operating-system))) (services services-mcdowell) (pam-services base-pam-services) (privileged-programs %default-privileged-programs) (setuid-programs %setuid-programs) (sudoers-file %sudoers-specification*) (location location-mcdowell)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; operating-system*