From a36dc9bb5115bc1e25dcf39bbc26d2bb44c23d0c Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Sun, 20 Dec 2020 12:11:44 +0100 Subject: [PATCH] config/guix/system: Init laptop-sasasa. Move mirror.brielmaier.net.pub to system dir to make it easier to share the whole setup. Centralize laptop common configs to default.scm. --- .config/guix/system/default.scm | 70 +++++++- .config/guix/system/laptop-mimimi.scm | 149 ++++++------------ .config/guix/system/laptop-sasasa.scm | 71 +++++++++ .../{ => system}/mirror.brielmaier.net.pub | 0 4 files changed, 183 insertions(+), 107 deletions(-) create mode 100644 .config/guix/system/laptop-sasasa.scm rename .config/guix/{ => system}/mirror.brielmaier.net.pub (100%) diff --git a/.config/guix/system/default.scm b/.config/guix/system/default.scm index 7a8103f6..b1a7fd5b 100644 --- a/.config/guix/system/default.scm +++ b/.config/guix/system/default.scm @@ -4,7 +4,8 @@ #:use-module (srfi srfi-1) #:use-module (gnu) #:use-module (gnu system nss) - #:use-module (gnu system mapped-devices)) + #:use-module (gnu system mapped-devices) + #:use-module (guix packages)) (use-service-modules desktop @@ -13,6 +14,7 @@ (use-package-modules certs ; nss-certs + gnome ; For gnome-minimal linux ; ntfs-3g mtools ; exfat nano ; To remove nano. @@ -30,6 +32,30 @@ "69-cdemu-vhba.rules" (string-append "KERNEL==\"vhba_ctl\", SUBSYSTEM==\"misc\", TAG+=\"uaccess\""))) +(define-public %ambrevar/xorg-touchpad + "Section \"InputClass\" + Identifier \"Touchpads\" + Driver \"libinput\" + MatchDevicePath \"/dev/input/event*\" + MatchIsTouchpad \"on\" + + Option \"DisableWhileTyping\" \"on\" + Option \"MiddleEmulation\" \"on\" + Option \"ClickMethod\" \"clickfinger\" + Option \"ScrollMethod\" \"twofinger\" + Option \"NaturalScrolling\" \"true\" +EndSection") + +(define-public %ambrevar/backlight-udev-rule + ;; Allow members of the "video" group to change the screen brightness. + (udev-rule + "90-backlight.rules" + (string-append "ACTION==\"add\", SUBSYSTEM==\"backlight\", " + "RUN+=\"/run/current-system/profile/bin/chgrp video /sys/class/backlight/%k/brightness\"" + "\n" + "ACTION==\"add\", SUBSYSTEM==\"backlight\", " + "RUN+=\"/run/current-system/profile/bin/chmod g+w /sys/class/backlight/%k/brightness\""))) + ;; Mount Nitrokey ;; TODO: Check if plugdev works instead of users. If not, report to Nitrokey. ;; https://www.nitrokey.com/sites/default/files/41-nitrokey.rules @@ -78,7 +104,7 @@ StrictNodes 1") (authorized-keys (append %default-authorized-guix-keys (list (local-file - (format #f "~a/.config/guix/mirror.brielmaier.net.pub" (getenv "HOME")))))))) + (format #f "~a/.config/guix/system/mirror.brielmaier.net.pub" (getenv "HOME")))))))) (udev-service-type config => (udev-configuration (inherit config) @@ -86,6 +112,46 @@ StrictNodes 1") (list ;; %nitrokey-udev-rule %ambrevar/cdemu-vhba-udev-rule)))))))) +(define-public gnome-minimal + (package + (inherit gnome) + (name "gnome-minimal") + (propagated-inputs + ;; Keep nautilus. + (fold alist-delete (package-propagated-inputs gnome) + '(;; GNOME-Core-Shell + "gnome-backgrounds" + "gnome-themes-extra" + "gnome-getting-started-docs" + "gnome-user-docs" + ;; GNOME-Core-Utilities + "baobab" + "cheese" + "eog" + "epiphany" + "evince" ; TODO: Remains pulled in with gnome-default-applications. + "file-roller" + "gedit" + "gnome-boxes" + "gnome-calculator" + "gnome-calendar" + "gnome-characters" + "gnome-clocks" + "gnome-contacts" + "gnome-disk-utility" + "gnome-font-viewer" + "gnome-maps" + ;; "gnome-music" + ;; "gnome-photos" + "gnome-screenshot" + ;; "gnome-system-monitor" ; TODO: Needed for gnome-polkit-settings: edit package to no break when gnome-system-monitor is missing. + "gnome-terminal" + "gnome-weather" + "simple-scan" + "totem" + ;; Others + "gnome-online-accounts"))))) + (define-public %ambrevar/packages (cons* nss-certs ; for HTTPS access ;; gvfs ; TODO: For user mounts? diff --git a/.config/guix/system/laptop-mimimi.scm b/.config/guix/system/laptop-mimimi.scm index 91125f5c..e0d2186a 100644 --- a/.config/guix/system/laptop-mimimi.scm +++ b/.config/guix/system/laptop-mimimi.scm @@ -48,37 +48,13 @@ ;; >> echo 'auto' > '/sys/bus/pci/devices/0000:02:00.0/power/control'; )) -(define %mimimi/xorg-touchpad - "Section \"InputClass\" - Identifier \"Touchpads\" - Driver \"libinput\" - MatchDevicePath \"/dev/input/event*\" - MatchIsTouchpad \"on\" - - Option \"DisableWhileTyping\" \"on\" - Option \"MiddleEmulation\" \"on\" - Option \"ClickMethod\" \"clickfinger\" - Option \"ScrollMethod\" \"twofinger\" - Option \"NaturalScrolling\" \"true\" -EndSection") - -(define %mimimi/backlight-udev-rule - ;; Allow members of the "video" group to change the screen brightness. - (udev-rule - "90-backlight.rules" - (string-append "ACTION==\"add\", SUBSYSTEM==\"backlight\", " - "RUN+=\"/run/current-system/profile/bin/chgrp video /sys/class/backlight/%k/brightness\"" - "\n" - "ACTION==\"add\", SUBSYSTEM==\"backlight\", " - "RUN+=\"/run/current-system/profile/bin/chmod g+w /sys/class/backlight/%k/brightness\""))) - (define %mimimi/xorg-minimal-config (xorg-configuration (modules (list xf86-video-vesa xf86-video-intel ;; xf86-video-nouveau ; Make sure this is on if the 'nouveau' kernel module is loaded. xf86-input-libinput)) - (extra-config (list %mimimi/xorg-touchpad)))) + (extra-config (list %ambrevar/xorg-touchpad)))) (define %mimimi/services (cons* @@ -106,47 +82,7 @@ EndSection") (udev-configuration (inherit config) (rules (append (udev-configuration-rules config) - (list %mimimi/backlight-udev-rule)))))))) - -(define-public gnome-minimal - (package - (inherit gnome) - (name "gnome-minimal") - (propagated-inputs - ;; Keep nautilus. - (fold alist-delete (package-propagated-inputs gnome) - '(;; GNOME-Core-Shell - "gnome-backgrounds" - "gnome-themes-extra" - "gnome-getting-started-docs" - "gnome-user-docs" - ;; GNOME-Core-Utilities - "baobab" - "cheese" - "eog" - "epiphany" - "evince" ; TODO: Remains pulled in with gnome-default-applications. - "file-roller" - "gedit" - "gnome-boxes" - "gnome-calculator" - "gnome-calendar" - "gnome-characters" - "gnome-clocks" - "gnome-contacts" - "gnome-disk-utility" - "gnome-font-viewer" - "gnome-maps" - ;; "gnome-music" - ;; "gnome-photos" - "gnome-screenshot" - ;; "gnome-system-monitor" ; TODO: Needed for gnome-polkit-settings: edit package to no break when gnome-system-monitor is missing. - "gnome-terminal" - "gnome-weather" - "simple-scan" - "totem" - ;; Others - "gnome-online-accounts"))))) + (list %ambrevar/backlight-udev-rule)))))))) (define drive-mapping (list (mapped-device @@ -163,47 +99,50 @@ EndSection") (options "subvol=rootfs,compress=zstd") (dependencies drive-mapping))) -(operating-system - (inherit %ambrevar/default-os) - (host-name "mimimi") +(define-public %ambrevar/laptop-os + (operating-system + (inherit %ambrevar/default-os) + (host-name "mimimi") - (kernel linux) - ;; (kernel linux-xiaomi-air-13) - ;; To disable the Nvidia, first make sure nouveau is not loaded then call - ;; sudo tee /proc/acpi/bbswitch << + (udev-configuration + (inherit config) + (rules (append (udev-configuration-rules config) + (list %ambrevar/backlight-udev-rule)))))))) + +(operating-system + (inherit %ambrevar/default-os) + (host-name "sasasa") + (kernel linux) + + (bootloader (bootloader-configuration + (bootloader grub-bootloader) + (timeout 1) + (target "/dev/sda"))) + + (file-systems (cons* (file-system + (device (file-system-label "guix")) + (mount-point "/") + (type "btrfs") + (options "subvol=rootfs,compress=zstd")) + (file-system + (mount-point "/tmp") + (device "none") + (type "tmpfs") + (check? #f)) + %base-file-systems)) + + (services (cons* (service gnome-desktop-service-type + (gnome-desktop-configuration + (gnome gnome-minimal))) + %sasasa/services))) diff --git a/.config/guix/mirror.brielmaier.net.pub b/.config/guix/system/mirror.brielmaier.net.pub similarity index 100% rename from .config/guix/mirror.brielmaier.net.pub rename to .config/guix/system/mirror.brielmaier.net.pub