Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (use-modules
- (gnu)
- (srfi srfi-1)
- (gnu system nss)
- (gnu services pm)
- (gnu services ssh)
- (gnu services cups)
- (gnu services guix)
- (gnu services desktop)
- (gnu services docker)
- (gnu services networking)
- (gnu services virtualization)
- (gnu packages wm)
- (gnu packages cups)
- (gnu packages vim)
- (gnu packages gtk)
- (gnu packages xorg)
- (gnu packages emacs)
- (gnu packages file-systems)
- (gnu packages gnome)
- (gnu packages mtools)
- (gnu packages linux)
- (gnu packages audio)
- (gnu packages gnuzilla)
- (gnu packages web-browsers)
- (gnu packages version-control)
- (gnu packages package-management)
- (nongnu packages linux)
- (nongnu system linux-initrd))
- (use-service-modules nix desktop networking xorg ssh)
- (use-package-modules certs shells ssh)
- ;; Allow members of the "video" group to change the screen brightness.
- (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\"")))
- ;; Modify configurations of default %desktop-services
- (define %my-desktop-services
- (modify-services %desktop-services
- ;; Configure the substitute server for the Nonguix repo
- (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 "nonguix.pub" "(public-key
- (ecc
- (curve Ed25519)
- (q #C1FD53E5D4CE971933EC50C9F307AE2171A2D3B52C804642A7A35F84F3A4EA98#)
- )
- )"))
- %default-authorized-guix-keys))))
- ;; Suspend the machine when the laptop lid is closed
- (elogind-service-type config =>
- (elogind-configuration (inherit config)
- (handle-lid-switch-external-power 'suspend)))
- ;; Enable backlight control rules for users
- (udev-service-type config =>
- (udev-configuration (inherit config)
- (rules (cons %backlight-udev-rule
- (udev-configuration-rules config)))))
- ;; Add OpenVPN support to NetworkManager
- (network-manager-service-type config =>
- (network-manager-configuration (inherit config)
- (vpn-plugins (list network-manager-openvpn))))))
- ;; Define a libinput configuration that works well for modern touchpads
- (define %xorg-libinput-config
- "Section \"InputClass\"
- Identifier \"Touchpads\"
- Driver \"libinput\"
- MatchDevicePath \"/dev/input/event*\"
- MatchIsTouchpad \"on\"
- Option \"Tapping\" \"on\"
- Option \"TappingDrag\" \"on\"
- Option \"DisableWhileTyping\" \"on\"
- Option \"MiddleEmulation\" \"on\"
- Option \"ScrollMethod\" \"twofinger\"
- EndSection
- Section \"InputClass\"
- Identifier \"Keyboards\"
- Driver \"libinput\"
- MatchDevicePath \"/dev/input/event*\"
- MatchIsKeyboard \"on\"
- EndSection
- ")
- (define-public base-operating-system
- (operating-system
- (host-name "proto")
- (timezone "Europe/Zurich")
- ;(timezone "America/Los_Angeles")
- (locale "en_US.utf8")
- ;; Use non-free Linux and firmware
- (kernel linux)
- (firmware (list linux-firmware))
- (initrd microcode-initrd)
- ;; Additional kernel modules
- (kernel-loadable-modules (list v4l2loopback-linux-module))
- ;; Choose US English keyboard layout. The "altgr-intl"
- ;; variant provides dead keys for accented characters.
- (keyboard-layout (keyboard-layout "us"))
- ;; Use the UEFI variant of GRUB with the EFI System
- ;; Partition mounted on /boot/efi.
- (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
- (device (file-system-label "system-root"))
- (mount-point "/")
- (type "ext4")
- (dependencies mapped-devices))
- (file-system
- (device "/dev/nvme0n1p2")
- (mount-point "/boot/efi")
- (type "vfat"))
- %base-file-systems))))
- (users (cons (user-account
- (name "rostick")
- (comment "rostick")
- (group "users")
- (home-directory "/home/rostick")
- (supplementary-groups '("wheel" ;; sudo
- "netdev" ;; network devices
- "kvm"
- "tty"
- "input"
- "docker"
- "realtime" ;; Enable realtime scheduling
- "lp" ;; control bluetooth devices
- "audio" ;; control audio devices
- "video"))) ;; control video devices
- %base-user-accounts))
- ;; Add the 'realtime' group
- (groups (cons (user-group (system? #t) (name "realtime"))
- %base-groups))
- ;; Install bare-minimum system packages
- (packages (append (map specification->package
- '("git"
- "ntfs-3g"
- "exfat-utils"
- "fuse-exfat"
- "stow"
- "vim"
- "emacs"
- "xterm"
- "bluez"
- "bluez-alsa"
- "tlp"
- "xf86-input-libinput"
- "nss-certs" ;; SSL root certificates
- "gvfs")) ;; Enable user mounts
- %base-packages))
- ;; Use the "desktop" services, which include the X11 log-in service,
- ;; networking with NetworkManager, and more
- (services (cons* (service slim-service-type
- (slim-configuration
- (xorg-configuration
- (xorg-configuration
- (keyboard-layout keyboard-layout)
- (extra-config (list %xorg-libinput-config))))))
- ;; Power and thermal management services
- (service thermald-service-type)
- (service tlp-service-type
- (tlp-configuration
- (cpu-boost-on-ac? #t)
- (wifi-pwr-on-bat? #t)))
- ;; Enable JACK to enter realtime mode
- (pam-limits-service
- (list
- (pam-limits-entry "@realtime" 'both 'rtprio 99)
- (pam-limits-entry "@realtime" 'both 'nice -19)
- (pam-limits-entry "@realtime" 'both 'memlock 'unlimited)))
- ;; Enable /usr/bin/env in shell scripts
- (extra-special-file "/usr/bin/env"
- (file-append coreutils "/bin/env"))
- ;; Enable Docker containers and virtual machines
- (service docker-service-type)
- (service libvirt-service-type
- (libvirt-configuration
- (unix-sock-group "libvirt")
- (tls-port "16555")))
- ;; Enable SSH access
- (service openssh-service-type
- (openssh-configuration
- (openssh openssh-sans-x)
- (port-number 2222)))
- ;; Enable the printing service
- (service cups-service-type
- (cups-configuration
- (web-interface? #t)
- (extensions
- (list cups-filters))))
- ;; Add udev rules to enable PipeWire use
- (udev-rules-service 'pipewire-add-udev-rules pipewire-0.3)
- ;; Enable the build service for Nix package manager
- (service nix-service-type)
- ;; Enable the bluetooth service
- (bluetooth-service #:auto-enable? #t)
- ;; Remove GDM, we're using SLiM instead
- (remove (lambda (service)
- (eq? (service-kind service) gdm-service-type))
- %my-desktop-services)))
- ;; Allow resolution of '.local' host names with mDNS
- (name-service-switch %mdns-host-lookup-nss)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement