(define-module (mf system) #:use-module (gnu bootloader) #:use-module (gnu bootloader grub) #:use-module (gnu system) #:use-module (gnu system accounts) #:use-module (gnu system file-systems) #:use-module (gnu system keyboard) #:use-module (gnu system mapped-devices) #:use-module (gnu system nss) #:use-module (gnu system shadow) #:use-module (gnu system uuid) #:use-module (gnu packages android) #:use-module (gnu packages certs) #:use-module (gnu packages cups) #:use-module (gnu packages cryptsetup) #:use-module (gnu packages emacs) #:use-module (gnu packages firmware) #:use-module (gnu packages haskell-apps) #:use-module (gnu packages kde-frameworks) #:use-module (gnu packages kde-pim) #:use-module (gnu packages kde-plasma) #:use-module (gnu packages kde-utils) #:use-module (gnu packages linux) #:use-module (gnu packages scanner) #:use-module (gnu packages security-token) #:use-module (gnu packages shells) #:use-module (gnu packages suckless) #:use-module (gnu packages version-control) #:use-module (gnu packages virtualization) #:use-module (gnu packages xorg) #:use-module (gnu packages wm) #:use-module (gnu services) #:use-module (gnu services base) #:use-module (gnu services cups) #:use-module (gnu services desktop) #:use-module (gnu services networking) #:use-module (gnu services pm) #:use-module (gnu services ssh) #:use-module (gnu services xorg) #:use-module (mf packages) #:use-module ((nongnu packages linux) #:prefix nonfree:) #:use-module (nongnu system linux-initrd) #:use-module (guix gexp) #:use-module (srfi srfi-1)) (define %backlight-udev-rule (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-public %my-desktop-services (cons* (service cups-service-type (cups-configuration (web-interface? #t))) (service plasma-desktop-service-type (plasma-desktop-configuration)) (udev-rules-service 'fido2 libfido2 #:groups '("plugdev")) (udev-rules-service 'yubikey yubikey-personalization) (modify-services %desktop-services (guix-service-type config => (guix-configuration (inherit config) (substitute-urls (append (list "https://substitutes.nonguix.org") %default-substitute-urls)) (authorized-keys (append (list (plain-file "non-guix.pub" "(public-key (ecc (curve Ed25519) (q #C1FD53E5D4CE971933EC50C9F307AE2171A2D3B52C804642A7A35F84F3A4EA98#) ) )")) %default-authorized-guix-keys)))) (elogind-service-type config => (elogind-configuration (inherit config) (handle-lid-switch-external-power 'suspend))) (udev-service-type config => (udev-configuration (inherit config) (rules (cons* %backlight-udev-rule kmonad android-udev-rules (udev-configuration-rules config)))))))) (define-public base-mf-system (operating-system (host-name "no-hostname") (kernel nonfree:linux) (initrd microcode-initrd) (firmware (list nonfree:linux-firmware)) (kernel-arguments '("modprobe.blacklist=usbmouse,usbkbd,pcspkr" "quiet")) (locale "en_US.utf8") (timezone "Europe/Rome") (keyboard-layout (keyboard-layout "us")) (groups (cons* (user-group (name "adbusers")) %base-groups)) (users (cons* (user-account (name "mario") (comment "Mario Forzanini") (group "users") (home-directory "/home/mario") (shell (file-append zsh "/bin/zsh")) (supplementary-groups '("wheel" "netdev" "audio" "kvm" "video" "lp" "plugdev" "input" "adbusers"))) %base-user-accounts)) (packages (cons* mf-dwm stumpwm+slynk emacs-no-x-toolkit cryptsetup git qemu slock thinkfan fwupd kded kmonad kfind kaccounts-providers kaccounts-integration print-manager bluedevil bluez-qt sane-backends xsane %base-packages)) (services (cons* (service bluetooth-service-type (bluetooth-configuration (auto-enable? #t))) (service openssh-service-type) (service nftables-service-type) (service tor-service-type) (service thermald-service-type) (service tlp-service-type (tlp-configuration (cpu-scaling-governor-on-ac '("performance")) (cpu-scaling-governor-on-bat '("powersave")))) (set-xorg-configuration (xorg-configuration (keyboard-layout keyboard-layout))) %my-desktop-services)) (bootloader (bootloader-configuration (bootloader grub-efi-bootloader) (targets '("/boot/efi")) (keyboard-layout keyboard-layout))) ;; Guix doesn't like it when there isn't a file-systems ;; entry, so add one that is meant to be overridden (file-systems (cons* (file-system (mount-point "/tmp") (device "none") (type "tmpfs") (check? #f)) %base-file-systems)) (name-service-switch %mdns-host-lookup-nss)))