2023-08-05 22:21:37 +00:00
|
|
|
#|Modules|#
|
|
|
|
(use-modules
|
2023-08-06 02:30:22 +00:00
|
|
|
#|GNU |# (gnu)
|
2023-08-27 21:47:12 +00:00
|
|
|
#|Guix |# (guix)
|
2023-08-15 23:22:46 +00:00
|
|
|
#|Radix|# (radix artwork)
|
2023-09-24 03:49:38 +00:00
|
|
|
(radix packages admin)
|
2023-08-15 23:22:46 +00:00
|
|
|
(radix packages linux)
|
2023-08-13 23:00:27 +00:00
|
|
|
(radix packages text-editors)
|
2023-09-21 19:03:55 +00:00
|
|
|
(radix packages shells)
|
2023-09-24 00:00:28 +00:00
|
|
|
(radix services admin)
|
2023-12-26 23:09:32 +00:00
|
|
|
(radix services pm)
|
2023-08-06 02:30:22 +00:00
|
|
|
(radix system setuid)
|
|
|
|
(radix secrets)
|
2023-08-06 19:20:09 +00:00
|
|
|
(radix utils)
|
2023-11-03 07:00:51 +00:00
|
|
|
((radix files substitute-keys) #:prefix public-key:)
|
|
|
|
((radix files thinkfan) #:prefix file:thinkfan-))
|
2023-08-06 02:30:22 +00:00
|
|
|
|
2023-08-05 22:21:37 +00:00
|
|
|
(use-service-modules
|
2023-08-27 14:16:13 +00:00
|
|
|
#|A|# admin avahi
|
2023-12-29 14:05:15 +00:00
|
|
|
#|D|# dbus desktop
|
2023-08-05 22:21:37 +00:00
|
|
|
#|M|# mcron
|
2023-12-02 20:07:31 +00:00
|
|
|
#|N|# linux networking
|
2023-08-27 17:20:46 +00:00
|
|
|
#|P|# pm
|
2023-08-08 01:32:20 +00:00
|
|
|
#|S|# sound sysctl)
|
2023-08-05 22:21:37 +00:00
|
|
|
|
|
|
|
(use-package-modules
|
2023-12-10 13:47:02 +00:00
|
|
|
#|A|# admin android
|
2023-08-07 23:50:30 +00:00
|
|
|
#|B|# base
|
2023-08-05 22:21:37 +00:00
|
|
|
#|C|# certs compression curl
|
|
|
|
#|G|# gawk glib guile guile-xyz
|
|
|
|
#|L|# less linux
|
2023-08-28 11:08:53 +00:00
|
|
|
#|M|# man
|
2023-12-29 14:07:01 +00:00
|
|
|
#|T|# texinfo
|
2023-08-05 22:21:37 +00:00
|
|
|
#|V|# vpn)
|
|
|
|
|
|
|
|
#|Operating system definition|#
|
|
|
|
(operating-system
|
|
|
|
(host-name "buer")
|
|
|
|
(timezone "America/Sao_Paulo")
|
|
|
|
(locale "en_US.utf8")
|
|
|
|
|
|
|
|
(keyboard-layout
|
|
|
|
(keyboard-layout "us,br"
|
2023-09-24 00:44:13 +00:00
|
|
|
#:options `("grp:menu_switch"
|
2023-08-05 22:21:37 +00:00
|
|
|
"parens:swap_brackets"
|
|
|
|
"caps:swapescape")))
|
|
|
|
|
|
|
|
(bootloader
|
|
|
|
(bootloader-configuration
|
|
|
|
(bootloader grub-bootloader)
|
2023-10-02 03:50:57 +00:00
|
|
|
(targets `("/dev/sda"))
|
2023-12-26 23:09:32 +00:00
|
|
|
(timeout 1)
|
2023-10-02 03:50:57 +00:00
|
|
|
(theme (grub-theme
|
|
|
|
(image (file-append %artwork-repository
|
|
|
|
"/backgrounds/guix-silver-16-9.svg"))
|
|
|
|
(gfxmode `("1280x720x32"))))))
|
2023-08-05 22:21:37 +00:00
|
|
|
|
2023-08-07 23:50:30 +00:00
|
|
|
(kernel-arguments
|
2023-09-24 00:44:13 +00:00
|
|
|
`("modprobe.blacklist=usbmouse,usbkbd,pcspkr"
|
|
|
|
"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))
|
|
|
|
|
|
|
|
(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-09-21 19:03:55 +00:00
|
|
|
(shell (file-append dash-next "/bin/dash"))
|
2023-08-10 17:43:41 +00:00
|
|
|
(uid 1000)
|
2023-08-07 23:50:30 +00:00
|
|
|
(group "users")
|
2023-12-23 00:04:24 +00:00
|
|
|
(supplementary-groups `("audio" "adbusers" "video" "wheel")))
|
2023-08-07 23:50:30 +00:00
|
|
|
(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")
|
2023-09-21 19:03:55 +00:00
|
|
|
(shell (file-append dash-next "/bin/dash")))
|
2023-08-07 23:50:30 +00:00
|
|
|
%base-user-accounts))
|
2023-08-05 22:21:37 +00:00
|
|
|
|
2023-12-23 00:04:24 +00:00
|
|
|
(groups
|
|
|
|
(cons* (user-group
|
|
|
|
(name "adbusers"))
|
|
|
|
%base-groups))
|
|
|
|
|
2023-08-05 22:21:37 +00:00
|
|
|
#|System level packages|#
|
|
|
|
(packages
|
2023-09-24 03:49:38 +00:00
|
|
|
(list #|admin |# htop inetutils isc-dhcp opendoas shadow zzz
|
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:58:33 +00:00
|
|
|
#|linux |# e2fsprogs eudev fuse iproute kbd kmod lm-sensors procps
|
2023-12-27 17:17:49 +00:00
|
|
|
psmisc util-linux
|
2023-08-05 22:21:37 +00:00
|
|
|
#|man |# man-db mandoc man-pages
|
2023-09-21 19:03:55 +00:00
|
|
|
#|shells |# dash-next
|
2023-08-05 22:21:37 +00:00
|
|
|
#|texinfo |# info-reader
|
2023-12-10 13:54:30 +00:00
|
|
|
#|text-editors|# kakoune-git
|
2023-08-05 22:21:37 +00:00
|
|
|
#|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
|
2023-09-24 00:44:13 +00:00
|
|
|
(shadow `("passwd" "chfn" "sg" "su" "newgrp" "newuidmap" "newgidmap"))
|
|
|
|
(inetutils `("ping" "ping6"))
|
|
|
|
(opendoas `("doas"))
|
|
|
|
(fuse-2 `("fusermount"))
|
|
|
|
(fuse `("fusermount3"))
|
|
|
|
(util-linux `("mount" "umount"))))
|
2023-08-28 12:21:52 +00:00
|
|
|
|
2023-08-05 22:21:37 +00:00
|
|
|
#|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
|
2023-09-24 00:44:13 +00:00
|
|
|
(%default-console-font `("tty1" "tty2"))))
|
2023-08-05 22:21:37 +00:00
|
|
|
(service agetty-service-type
|
|
|
|
(agetty-configuration
|
2023-09-24 00:44:13 +00:00
|
|
|
(extra-options `("-L"))
|
2023-08-05 22:21:37 +00:00
|
|
|
(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))))
|
|
|
|
|
2023-12-29 14:05:15 +00:00
|
|
|
#|IPC services|#
|
|
|
|
(service dbus-root-service-type)
|
|
|
|
|
2023-08-27 14:16:13 +00:00
|
|
|
#|Avahi service|#
|
|
|
|
(service avahi-service-type
|
|
|
|
(avahi-configuration
|
|
|
|
(wide-area? #t)))
|
|
|
|
|
2023-08-05 22:21:37 +00:00
|
|
|
#|Guix services|#
|
|
|
|
(service guix-service-type
|
|
|
|
(guix-configuration
|
2023-08-27 14:16:13 +00:00
|
|
|
(discover? #t)
|
2023-08-05 22:21:37 +00:00
|
|
|
(build-accounts 16)
|
2023-11-03 07:00:51 +00:00
|
|
|
(authorized-keys
|
|
|
|
(cons* public-key:yuria
|
|
|
|
%default-authorized-guix-keys))
|
2023-09-24 00:44:13 +00:00
|
|
|
(extra-options `("--max-jobs=8" "--cores=4"))))
|
2023-08-27 14:16:13 +00:00
|
|
|
(service guix-publish-service-type
|
|
|
|
(guix-publish-configuration
|
|
|
|
(port 8080)
|
2023-09-27 09:51:22 +00:00
|
|
|
(host "0.0.0.0")
|
2023-08-27 14:16:13 +00:00
|
|
|
(advertise? #t)
|
2023-09-26 20:09:05 +00:00
|
|
|
(compression `(("zstd" 3)))))
|
2023-08-05 22:21:37 +00:00
|
|
|
|
|
|
|
#|Mcron service|#
|
|
|
|
(simple-service 'mcron-jobs mcron-service-type
|
2023-08-08 18:27:49 +00:00
|
|
|
(list #~(job "5 0 * * *"
|
2023-08-26 21:55:06 +00:00
|
|
|
"guix gc --optimize --free-space=5G")))
|
2023-08-05 22:21:37 +00:00
|
|
|
|
|
|
|
#|Device management services|#
|
|
|
|
(service udev-service-type
|
|
|
|
(udev-configuration
|
|
|
|
(udev eudev)
|
2023-12-10 13:47:02 +00:00
|
|
|
(rules (list alsa-utils
|
|
|
|
android-udev-rules
|
|
|
|
crda
|
|
|
|
fuse
|
|
|
|
lvm2))))
|
2023-08-05 22:21:37 +00:00
|
|
|
|
|
|
|
#|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)))))
|
2023-11-22 20:20:06 +00:00
|
|
|
(service ntp-service-type)
|
2023-08-05 22:21:37 +00:00
|
|
|
(service wpa-supplicant-service-type
|
|
|
|
(wpa-supplicant-configuration
|
|
|
|
(config-file "/etc/wpa_supplicant.conf")
|
|
|
|
(interface "wlp2s0")
|
2023-09-24 00:44:13 +00:00
|
|
|
(extra-options `("-B"))))
|
2023-08-05 22:21:37 +00:00
|
|
|
(service dhcp-client-service-type
|
|
|
|
(dhcp-client-configuration
|
|
|
|
(interfaces 'all)))
|
2023-09-17 23:03:03 +00:00
|
|
|
(service tor-service-type)
|
2023-08-05 22:21:37 +00:00
|
|
|
|
2023-08-27 17:20:46 +00:00
|
|
|
#|Power management services|#
|
|
|
|
(service tlp-service-type
|
|
|
|
(tlp-configuration
|
2023-09-24 00:44:13 +00:00
|
|
|
(cpu-scaling-governor-on-ac `("performance"))
|
|
|
|
(cpu-scaling-governor-on-bat `("powersave"))
|
2023-08-27 17:20:46 +00:00
|
|
|
(cpu-scaling-min-freq-on-ac 1500000)
|
|
|
|
(cpu-scaling-max-freq-on-ac 3500000)
|
|
|
|
(cpu-scaling-min-freq-on-bat 1000000)
|
|
|
|
(cpu-scaling-max-freq-on-bat 3000000)
|
|
|
|
(cpu-min-perf-on-ac 0)
|
|
|
|
(cpu-max-perf-on-ac 100)
|
|
|
|
(cpu-min-perf-on-bat 0)
|
|
|
|
(cpu-max-perf-on-bat 40)
|
|
|
|
(cpu-boost-on-ac? #t)
|
|
|
|
(cpu-boost-on-bat? #f)
|
|
|
|
(nmi-watchdog? #t)
|
|
|
|
(start-charge-thresh-bat0 70)
|
|
|
|
(stop-charge-thresh-bat0 90)))
|
2023-12-29 14:06:23 +00:00
|
|
|
(service thinkfan-service-type
|
|
|
|
(thinkfan-configuration
|
|
|
|
(thinkfan thinkfan-next)
|
|
|
|
(config-file file:thinkfan-config)))
|
2023-08-27 17:20:46 +00:00
|
|
|
(service thermald-service-type)
|
|
|
|
|
2023-12-02 20:07:31 +00:00
|
|
|
#|Memory management services|#
|
|
|
|
(service zram-device-service-type
|
|
|
|
(zram-device-configuration
|
|
|
|
(size "2G")
|
|
|
|
(compression-algorithm 'zstd)))
|
|
|
|
|
2023-09-24 00:44:13 +00:00
|
|
|
#|Doas configuration services|#
|
2023-09-24 13:25:01 +00:00
|
|
|
(simple-service 'miscellaneous-permissions doas-service-type
|
|
|
|
(list (permit (identity ":wheel")
|
2023-11-25 15:08:25 +00:00
|
|
|
(setenv `(("GUILE_LOAD_PATH" . #t))))
|
2023-09-24 13:25:01 +00:00
|
|
|
(permit (identity ":wheel")
|
|
|
|
(nopass? #t)
|
|
|
|
(command "guix")
|
|
|
|
(args `("pull")))))
|
|
|
|
(simple-service 'text-editors-permissions doas-service-type
|
|
|
|
(map (lambda (cmd)
|
|
|
|
(permit (identity ":wheel")
|
|
|
|
(keepenv? #t)
|
|
|
|
(command cmd)))
|
|
|
|
`("kak" "emacsclient")))
|
|
|
|
(simple-service 'power-management-permissions doas-service-type
|
|
|
|
(map (lambda (cmd)
|
2023-09-24 00:00:28 +00:00
|
|
|
(permit (identity ":wheel")
|
|
|
|
(nopass? #t)
|
2023-09-24 13:25:01 +00:00
|
|
|
(command cmd)
|
|
|
|
(args '())))
|
|
|
|
`("zzz" "halt" "reboot")))
|
|
|
|
(simple-service 'shepherd-status-permissions doas-service-type
|
2023-11-29 02:14:01 +00:00
|
|
|
(map (lambda (action)
|
2023-09-24 00:00:28 +00:00
|
|
|
(permit (identity ":wheel")
|
|
|
|
(nopass? #t)
|
|
|
|
(command "herd")
|
2023-11-29 02:14:01 +00:00
|
|
|
(args (list action))))
|
2023-09-24 13:25:01 +00:00
|
|
|
`("status" "detailed-status")))
|
|
|
|
(simple-service 'service-management-permissions doas-service-type
|
2023-12-02 13:42:19 +00:00
|
|
|
(flat-map (lambda (service action)
|
|
|
|
(permit (identity ":wheel")
|
|
|
|
(nopass? #t)
|
|
|
|
(command "herd")
|
|
|
|
(args (map symbol->string
|
|
|
|
(list action service)))))
|
2023-12-02 20:08:48 +00:00
|
|
|
'(tor networking wpa-supplicant)
|
2023-12-02 13:42:19 +00:00
|
|
|
'(doc stop start enable status restart disable)))
|
2023-08-05 22:21:37 +00:00
|
|
|
#|Special file services|#
|
|
|
|
(service special-files-service-type
|
2023-09-21 19:03:55 +00:00
|
|
|
`(("/bin/sh" ,(file-append dash-next "/bin/dash"))
|
2023-08-08 18:27:49 +00:00
|
|
|
("/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"))
|
2023-09-24 00:44:13 +00:00
|
|
|
(settings `(("fs.protected_hardlinks" . "1")
|
2023-08-05 22:21:37 +00:00
|
|
|
("fs.protected_symlinks" . "1"))))))))
|