2023-08-05 22:21:37 +00:00
|
|
|
#|Modules|#
|
|
|
|
(use-modules
|
2023-08-06 02:30:22 +00:00
|
|
|
#|GNU |# (gnu)
|
|
|
|
(gnu artwork)
|
|
|
|
(gnu services)
|
|
|
|
#|Guix |# (guix gexp)
|
2023-08-05 22:21:37 +00:00
|
|
|
#|Misc |# (ice-9 match)
|
2023-08-06 02:30:22 +00:00
|
|
|
#|Radix|# (radix packages linux)
|
|
|
|
(radix services linux)
|
|
|
|
(radix system setuid)
|
|
|
|
(radix secrets)
|
2023-08-06 19:20:09 +00:00
|
|
|
(radix utils)
|
2023-08-08 19:00:46 +00:00
|
|
|
((radix files doas) #:prefix file:doas-)
|
2023-08-06 19:20:09 +00:00
|
|
|
((radix files thinkfan) #:prefix file:thinkfan-))
|
2023-08-06 02:30:22 +00:00
|
|
|
|
|
|
|
(use-system-modules
|
|
|
|
#|N|# nss)
|
2023-08-05 22:21:37 +00:00
|
|
|
|
|
|
|
(use-service-modules
|
|
|
|
#|A|# admin
|
|
|
|
#|D|# desktop
|
|
|
|
#|M|# mcron
|
|
|
|
#|N|# networking
|
2023-08-08 01:32:20 +00:00
|
|
|
#|S|# sound sysctl)
|
2023-08-05 22:21:37 +00:00
|
|
|
|
|
|
|
(use-package-modules
|
|
|
|
#|A|# admin
|
2023-08-07 23:50:30 +00:00
|
|
|
#|B|# base
|
2023-08-05 22:21:37 +00:00
|
|
|
#|C|# certs compression curl
|
|
|
|
#|F|# file
|
|
|
|
#|G|# gawk glib guile guile-xyz
|
|
|
|
#|L|# less linux
|
|
|
|
#|M|# man maths
|
2023-08-07 23:50:30 +00:00
|
|
|
#|S|# shells
|
2023-08-05 22:21:37 +00:00
|
|
|
#|T|# texinfo text-editors tmux
|
|
|
|
#|V|# vpn)
|
|
|
|
|
|
|
|
#|Operating system definition|#
|
|
|
|
(operating-system
|
|
|
|
(host-name "buer")
|
|
|
|
(timezone "America/Sao_Paulo")
|
|
|
|
(locale "en_US.utf8")
|
|
|
|
|
|
|
|
(keyboard-layout
|
|
|
|
(keyboard-layout "us,br"
|
|
|
|
#:options '("grp:menu_switch"
|
|
|
|
"parens:swap_brackets"
|
|
|
|
"caps:swapescape")))
|
|
|
|
|
|
|
|
(bootloader
|
|
|
|
(bootloader-configuration
|
|
|
|
(bootloader grub-bootloader)
|
|
|
|
(targets '("/dev/sda"))
|
|
|
|
(theme (grub-theme
|
|
|
|
(image (file-append %artwork-repository
|
|
|
|
"/backgrounds/guix-silver-checkered-16-9.svg"))
|
|
|
|
(resolution '(1280 . 720))
|
|
|
|
(gfxmode '("1280x720x32"))))))
|
|
|
|
|
2023-08-07 23:50:30 +00:00
|
|
|
(kernel-arguments
|
2023-08-08 18:27:49 +00:00
|
|
|
(list "modprobe.blacklist=usbmouse,usbkbd"
|
|
|
|
"thinkpad_acpi.fan_control=1"
|
|
|
|
"loglevel=5"
|
|
|
|
"quiet"))
|
2023-08-05 22:21:37 +00:00
|
|
|
|
|
|
|
(file-systems
|
|
|
|
(cons* (file-system
|
|
|
|
(device (file-system-label "guix-root"))
|
|
|
|
(mount-point "/")
|
|
|
|
(type "ext4"))
|
|
|
|
(file-system
|
2023-08-11 12:33:19 +00:00
|
|
|
(device (file-system-label "home"))
|
2023-08-05 22:21:37 +00:00
|
|
|
(mount-point "/home")
|
|
|
|
(type "ext4"))
|
|
|
|
%base-file-systems))
|
|
|
|
|
|
|
|
(swap-devices
|
|
|
|
(list (swap-space
|
|
|
|
(target (file-system-label "swap")))))
|
|
|
|
|
|
|
|
(users
|
2023-08-07 23:50:30 +00:00
|
|
|
(cons* (user-account
|
|
|
|
(name "radio")
|
|
|
|
(password %radio-password)
|
2023-08-10 17:43:41 +00:00
|
|
|
(home-directory "/home/radio")
|
2023-08-07 23:50:30 +00:00
|
|
|
(shell (file-append dash "/bin/dash"))
|
2023-08-10 17:43:41 +00:00
|
|
|
(uid 1000)
|
2023-08-07 23:50:30 +00:00
|
|
|
(group "users")
|
|
|
|
(supplementary-groups `("audio" "input" "video" "wheel")))
|
|
|
|
(user-account
|
|
|
|
(name "root")
|
|
|
|
(password %root-password)
|
2023-08-10 22:17:34 +00:00
|
|
|
(system? #t)
|
2023-08-10 17:43:41 +00:00
|
|
|
(home-directory "/root")
|
2023-08-07 23:50:30 +00:00
|
|
|
(uid 0)
|
|
|
|
(group "root")
|
|
|
|
(shell (file-append dash "/bin/dash")))
|
|
|
|
%base-user-accounts))
|
2023-08-05 22:21:37 +00:00
|
|
|
|
|
|
|
#|System level packages|#
|
|
|
|
(packages
|
|
|
|
(list #|admin |# htop inetutils isc-dhcp opendoas shadow
|
2023-08-07 23:38:40 +00:00
|
|
|
#|base |# coreutils diffutils findutils grep patch sed tar which
|
2023-08-05 22:21:37 +00:00
|
|
|
#|certs |# nss-certs
|
2023-08-07 23:38:40 +00:00
|
|
|
#|compression |# bzip2 gzip lzip unzip xz zstd
|
2023-08-05 22:21:37 +00:00
|
|
|
#|curl |# curl
|
|
|
|
#|gawk |# gawk
|
2023-08-06 23:03:29 +00:00
|
|
|
#|guile |# guile-3.0-latest guile-colorized guile-readline
|
2023-08-05 22:21:37 +00:00
|
|
|
#|less |# less
|
2023-08-13 19:11:14 +00:00
|
|
|
#|linux |# e2fsprogs eudev fuse inotify-tools iproute kbd kmod
|
|
|
|
lm-sensors procps psmisc thinkfan-next util-linux
|
2023-08-05 22:21:37 +00:00
|
|
|
#|man |# man-db mandoc man-pages
|
|
|
|
#|math |# libqalculate
|
2023-08-07 23:50:30 +00:00
|
|
|
#|shells |# dash
|
2023-08-05 22:21:37 +00:00
|
|
|
#|texinfo |# info-reader
|
2023-08-07 23:38:40 +00:00
|
|
|
#|text-editors|# kakoune
|
2023-08-05 22:21:37 +00:00
|
|
|
#|tmux |# tmux
|
|
|
|
#|vpn |# wireguard-tools))
|
|
|
|
|
|
|
|
#|Do not generate a sudoers file|#
|
|
|
|
(sudoers-file #f)
|
|
|
|
|
|
|
|
#|Run some programs from each package with file owner privileges|#
|
|
|
|
(setuid-programs
|
|
|
|
(map-setuid-programs
|
|
|
|
(shadow '("passwd" "chfn" "sg" "su" "newgrp" "newuidmap" "newgidmap"))
|
|
|
|
(inetutils '("ping" "ping6"))
|
|
|
|
(opendoas '("doas"))
|
|
|
|
(fuse '("fusermount"))
|
|
|
|
(util-linux '("mount" "umount"))))
|
|
|
|
|
|
|
|
#|Allow resolution of '.local' host names with mDNS|#
|
|
|
|
(name-service-switch %mdns-host-lookup-nss)
|
|
|
|
|
|
|
|
#|System services|#
|
|
|
|
(services
|
|
|
|
(list #|TTY services|#
|
|
|
|
(service virtual-terminal-service-type)
|
|
|
|
(service console-font-service-type
|
|
|
|
(associate-right
|
|
|
|
(%default-console-font '("tty1" "tty2"))))
|
|
|
|
(service agetty-service-type
|
|
|
|
(agetty-configuration
|
|
|
|
(extra-options '("-L"))
|
|
|
|
(term "vt100")
|
|
|
|
(tty #f)))
|
|
|
|
(service mingetty-service-type
|
|
|
|
(mingetty-configuration (tty "tty1")))
|
|
|
|
(service mingetty-service-type
|
|
|
|
(mingetty-configuration (tty "tty2")))
|
|
|
|
|
|
|
|
#|Login services|#
|
|
|
|
(service login-service-type)
|
|
|
|
(service elogind-service-type)
|
|
|
|
|
|
|
|
#|Log services|#
|
|
|
|
(service rottlog-service-type)
|
|
|
|
(service syslog-service-type
|
|
|
|
(syslog-configuration
|
|
|
|
(syslogd (file-append inetutils "/libexec/syslogd"))
|
|
|
|
(config-file %default-syslog.conf)))
|
|
|
|
(service log-cleanup-service-type
|
|
|
|
(log-cleanup-configuration
|
|
|
|
(directory "/var/log/guix/drvs")
|
|
|
|
(expiry (* 3 30 24 3600))))
|
|
|
|
|
|
|
|
#|Guix services|#
|
|
|
|
(service guix-service-type
|
|
|
|
(guix-configuration
|
|
|
|
(build-accounts 16)
|
|
|
|
(extra-options '("--max-jobs=8" "--cores=4"))))
|
|
|
|
|
|
|
|
#|Mcron service|#
|
|
|
|
(simple-service 'mcron-jobs mcron-service-type
|
2023-08-08 18:27:49 +00:00
|
|
|
(list #~(job "5 0 * * *"
|
|
|
|
"guix gc --optimize -F 5G")))
|
2023-08-05 22:21:37 +00:00
|
|
|
|
|
|
|
#|Device management services|#
|
|
|
|
(service udev-service-type
|
|
|
|
(udev-configuration
|
|
|
|
(udev eudev)
|
|
|
|
(rules (list lvm2 fuse alsa-utils crda))))
|
|
|
|
|
|
|
|
#|Sound services|#
|
|
|
|
(service alsa-service-type)
|
|
|
|
|
|
|
|
#|Network services|#
|
|
|
|
(service static-networking-service-type
|
|
|
|
(list (static-networking
|
|
|
|
(addresses
|
2023-08-08 18:27:49 +00:00
|
|
|
(list (network-address
|
|
|
|
(device "lo")
|
|
|
|
(value "127.0.0.1/8"))))
|
2023-08-05 22:21:37 +00:00
|
|
|
(provision '(loopback)))))
|
|
|
|
(service wpa-supplicant-service-type
|
|
|
|
(wpa-supplicant-configuration
|
|
|
|
(config-file "/etc/wpa_supplicant.conf")
|
|
|
|
(interface "wlp2s0")
|
|
|
|
(extra-options '("-B"))))
|
|
|
|
(service dhcp-client-service-type
|
|
|
|
(dhcp-client-configuration
|
|
|
|
(interfaces 'all)))
|
|
|
|
|
|
|
|
#|Thinkfan services|#
|
|
|
|
(simple-service 'thinkfan-config etc-service-type
|
2023-08-08 18:27:49 +00:00
|
|
|
`(("modprobe.d/thinkfan.conf" ,file:thinkfan-modprobe-config)
|
|
|
|
("thinkfan.conf" ,file:thinkfan-config)))
|
2023-08-05 22:21:37 +00:00
|
|
|
(service thinkfan-service-type
|
|
|
|
(thinkfan-configuration
|
2023-08-06 19:20:09 +00:00
|
|
|
(config-file file:thinkfan-config)
|
2023-08-05 22:21:37 +00:00
|
|
|
(respawn? #f)))
|
|
|
|
|
|
|
|
#|Doas config service|#
|
|
|
|
(simple-service 'doas-config etc-service-type
|
2023-08-08 18:27:49 +00:00
|
|
|
`(("doas.conf" ,file:doas-config)))
|
2023-08-05 22:21:37 +00:00
|
|
|
|
|
|
|
#|Special file services|#
|
|
|
|
(service special-files-service-type
|
2023-08-08 18:27:49 +00:00
|
|
|
`(("/bin/sh" ,(file-append dash "/bin/dash"))
|
|
|
|
("/usr/bin/env" ,(file-append coreutils "/bin/env"))))
|
2023-08-05 22:21:37 +00:00
|
|
|
|
|
|
|
#|Miscellaneous services|#
|
|
|
|
(service urandom-seed-service-type)
|
|
|
|
(service nscd-service-type)
|
|
|
|
(service sysctl-service-type
|
|
|
|
(sysctl-configuration
|
|
|
|
(sysctl (file-append procps "/sbin/sysctl"))
|
|
|
|
(settings '(("fs.protected_hardlinks" . "1")
|
|
|
|
("fs.protected_symlinks" . "1"))))))))
|