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.master
parent
5065c5ba5e
commit
a36dc9bb51
|
@ -4,7 +4,8 @@
|
||||||
#:use-module (srfi srfi-1)
|
#:use-module (srfi srfi-1)
|
||||||
#:use-module (gnu)
|
#:use-module (gnu)
|
||||||
#:use-module (gnu system nss)
|
#:use-module (gnu system nss)
|
||||||
#:use-module (gnu system mapped-devices))
|
#:use-module (gnu system mapped-devices)
|
||||||
|
#:use-module (guix packages))
|
||||||
|
|
||||||
(use-service-modules
|
(use-service-modules
|
||||||
desktop
|
desktop
|
||||||
|
@ -13,6 +14,7 @@
|
||||||
|
|
||||||
(use-package-modules
|
(use-package-modules
|
||||||
certs ; nss-certs
|
certs ; nss-certs
|
||||||
|
gnome ; For gnome-minimal
|
||||||
linux ; ntfs-3g
|
linux ; ntfs-3g
|
||||||
mtools ; exfat
|
mtools ; exfat
|
||||||
nano ; To remove nano.
|
nano ; To remove nano.
|
||||||
|
@ -30,6 +32,30 @@
|
||||||
"69-cdemu-vhba.rules"
|
"69-cdemu-vhba.rules"
|
||||||
(string-append "KERNEL==\"vhba_ctl\", SUBSYSTEM==\"misc\", TAG+=\"uaccess\"")))
|
(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
|
;; Mount Nitrokey
|
||||||
;; TODO: Check if plugdev works instead of users. If not, report to Nitrokey.
|
;; TODO: Check if plugdev works instead of users. If not, report to Nitrokey.
|
||||||
;; https://www.nitrokey.com/sites/default/files/41-nitrokey.rules
|
;; https://www.nitrokey.com/sites/default/files/41-nitrokey.rules
|
||||||
|
@ -78,7 +104,7 @@ StrictNodes 1")
|
||||||
(authorized-keys (append
|
(authorized-keys (append
|
||||||
%default-authorized-guix-keys
|
%default-authorized-guix-keys
|
||||||
(list (local-file
|
(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-service-type config =>
|
||||||
(udev-configuration
|
(udev-configuration
|
||||||
(inherit config)
|
(inherit config)
|
||||||
|
@ -86,6 +112,46 @@ StrictNodes 1")
|
||||||
(list ;; %nitrokey-udev-rule
|
(list ;; %nitrokey-udev-rule
|
||||||
%ambrevar/cdemu-vhba-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
|
(define-public %ambrevar/packages
|
||||||
(cons* nss-certs ; for HTTPS access
|
(cons* nss-certs ; for HTTPS access
|
||||||
;; gvfs ; TODO: For user mounts?
|
;; gvfs ; TODO: For user mounts?
|
||||||
|
|
|
@ -48,37 +48,13 @@
|
||||||
;; >> echo 'auto' > '/sys/bus/pci/devices/0000:02:00.0/power/control';
|
;; >> 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
|
(define %mimimi/xorg-minimal-config
|
||||||
(xorg-configuration
|
(xorg-configuration
|
||||||
(modules (list xf86-video-vesa
|
(modules (list xf86-video-vesa
|
||||||
xf86-video-intel
|
xf86-video-intel
|
||||||
;; xf86-video-nouveau ; Make sure this is on if the 'nouveau' kernel module is loaded.
|
;; xf86-video-nouveau ; Make sure this is on if the 'nouveau' kernel module is loaded.
|
||||||
xf86-input-libinput))
|
xf86-input-libinput))
|
||||||
(extra-config (list %mimimi/xorg-touchpad))))
|
(extra-config (list %ambrevar/xorg-touchpad))))
|
||||||
|
|
||||||
(define %mimimi/services
|
(define %mimimi/services
|
||||||
(cons*
|
(cons*
|
||||||
|
@ -106,47 +82,7 @@ EndSection")
|
||||||
(udev-configuration
|
(udev-configuration
|
||||||
(inherit config)
|
(inherit config)
|
||||||
(rules (append (udev-configuration-rules config)
|
(rules (append (udev-configuration-rules config)
|
||||||
(list %mimimi/backlight-udev-rule))))))))
|
(list %ambrevar/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")))))
|
|
||||||
|
|
||||||
(define drive-mapping
|
(define drive-mapping
|
||||||
(list (mapped-device
|
(list (mapped-device
|
||||||
|
@ -163,47 +99,50 @@ EndSection")
|
||||||
(options "subvol=rootfs,compress=zstd")
|
(options "subvol=rootfs,compress=zstd")
|
||||||
(dependencies drive-mapping)))
|
(dependencies drive-mapping)))
|
||||||
|
|
||||||
(operating-system
|
(define-public %ambrevar/laptop-os
|
||||||
(inherit %ambrevar/default-os)
|
(operating-system
|
||||||
(host-name "mimimi")
|
(inherit %ambrevar/default-os)
|
||||||
|
(host-name "mimimi")
|
||||||
|
|
||||||
(kernel linux)
|
(kernel linux)
|
||||||
;; (kernel linux-xiaomi-air-13)
|
;; (kernel linux-xiaomi-air-13)
|
||||||
;; To disable the Nvidia, first make sure nouveau is not loaded then call
|
;; To disable the Nvidia, first make sure nouveau is not loaded then call
|
||||||
;; sudo tee /proc/acpi/bbswitch <<<OFF
|
;; sudo tee /proc/acpi/bbswitch <<<OFF
|
||||||
;; Check the result with
|
;; Check the result with
|
||||||
;; sudo dmesg | grep bbswitch
|
;; sudo dmesg | grep bbswitch
|
||||||
;; It saves about 1h of battery.
|
;; It saves about 1h of battery.
|
||||||
;; TODO: Automate the bbswitch command when the Guix package is merged.
|
;; TODO: Automate the bbswitch command when the Guix package is merged.
|
||||||
(kernel-arguments '("modprobe.blacklist=nouveau"))
|
(kernel-arguments '("modprobe.blacklist=nouveau"))
|
||||||
|
|
||||||
(mapped-devices drive-mapping)
|
(mapped-devices drive-mapping)
|
||||||
|
|
||||||
(firmware (append (list iwlwifi-firmware)
|
(firmware (append (list iwlwifi-firmware)
|
||||||
%ambrevar/firmware))
|
%ambrevar/firmware))
|
||||||
|
|
||||||
(file-systems (cons* root-partition
|
(file-systems (cons* root-partition
|
||||||
;; TODO: Separate boot partition (to avoid double LUKS
|
;; TODO: Separate boot partition (to avoid double LUKS
|
||||||
;; password prompt) does not work:
|
;; password prompt) does not work:
|
||||||
;; (file-system
|
;; (file-system
|
||||||
;; (device (file-system-label "boot"))
|
;; (device (file-system-label "boot"))
|
||||||
;; (mount-point "/boot")
|
;; (mount-point "/boot")
|
||||||
;; (type "ext4")
|
;; (type "ext4")
|
||||||
;; ;; (needed-for-boot? #t)
|
;; ;; (needed-for-boot? #t)
|
||||||
;; (dependencies (list root-partition))
|
;; (dependencies (list root-partition))
|
||||||
;; )
|
;; )
|
||||||
(file-system
|
(file-system
|
||||||
(device (uuid "4E30-891F" 'fat))
|
(device (uuid "4E30-891F" 'fat))
|
||||||
(mount-point "/boot/efi")
|
(mount-point "/boot/efi")
|
||||||
(type "vfat"))
|
(type "vfat"))
|
||||||
(file-system
|
(file-system
|
||||||
(mount-point "/tmp")
|
(mount-point "/tmp")
|
||||||
(device "none")
|
(device "none")
|
||||||
(type "tmpfs")
|
(type "tmpfs")
|
||||||
(check? #f))
|
(check? #f))
|
||||||
%base-file-systems))
|
%base-file-systems))
|
||||||
|
|
||||||
(services (cons* (service gnome-desktop-service-type
|
(services (cons* (service gnome-desktop-service-type
|
||||||
(gnome-desktop-configuration
|
(gnome-desktop-configuration
|
||||||
(gnome gnome-minimal)))
|
(gnome gnome-minimal)))
|
||||||
%mimimi/services)))
|
%mimimi/services))))
|
||||||
|
|
||||||
|
%ambrevar/laptop-os
|
||||||
|
|
|
@ -0,0 +1,71 @@
|
||||||
|
;; With Eshell:
|
||||||
|
;; *sudo -E guix system -L ~/.config/guix/system reconfigure ~/.config/guix/system/laptop-sasasa.scm
|
||||||
|
(define-module (laptop-sasasa)
|
||||||
|
#:use-module (srfi srfi-1)
|
||||||
|
#:use-module (default)
|
||||||
|
#:use-module (nongnu packages linux)
|
||||||
|
#:use-module (gnu)
|
||||||
|
#:use-module (gnu system))
|
||||||
|
|
||||||
|
(use-service-modules
|
||||||
|
desktop ; GNOME
|
||||||
|
;; GDM:
|
||||||
|
xorg)
|
||||||
|
|
||||||
|
(use-package-modules
|
||||||
|
emacs-xyz ; For exwm config.
|
||||||
|
;; For Xorg modules:
|
||||||
|
xorg)
|
||||||
|
|
||||||
|
(define %sasasa/services
|
||||||
|
(cons*
|
||||||
|
;; TODO: How can I choose which display to focus by default? Order seems not
|
||||||
|
;; to matter.
|
||||||
|
(service slim-service-type
|
||||||
|
(slim-configuration
|
||||||
|
(display ":0")
|
||||||
|
(vt "vt7")))
|
||||||
|
(service slim-service-type
|
||||||
|
(slim-configuration
|
||||||
|
(display ":1")
|
||||||
|
(vt "vt8")
|
||||||
|
(auto-login? #f)
|
||||||
|
(default-user "ambrevar")
|
||||||
|
(auto-login-session (file-append emacs-exwm-no-x-toolkit
|
||||||
|
"/bin/exwm"))))
|
||||||
|
(modify-services
|
||||||
|
(remove (lambda (service)
|
||||||
|
(eq? (service-kind service) gdm-service-type))
|
||||||
|
%ambrevar/services)
|
||||||
|
(udev-service-type config =>
|
||||||
|
(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)))
|
Loading…
Reference in New Issue