rosenthal: Add packages and variables from testament.

* modules/rosenthal/packages/linux.scm (default-initrd-configs)
(cachyos-configs): New procedures.
(linux-cachyos-lts-server, linux-cachyos-bore-zen4): New variables.
* modules/rosenthal/utils/others.scm (%rosenthal-guix-key-dorphine)
(%rosenthal-guix-key-nuporta, %rosenthal-guix-key-bocis)
(%rosenthal-guix-key-ignamma, %rosenthal-ssh-key-hako)
(%rosenthal-ssh-key-hako-deploy, %rosenthal-ssh-key-jonathan)
(%rosenthal-ssh-key-podiki, %rosenthal-network-manager-ipv6-privacy)
(%rosenthal-network-manager-random-mac-address, %rosenthal-cli-packages): New
variables.
This commit is contained in:
Hilton Chain committed 2026-09-28 20:03:46 +08:00
1 parent 8aae7d26dd
commit 805ea83faf
2 files changed
+411

No files matched your search

+287
View File
@@ -0,0 +1,287 @@
;;; SPDX-License-Identifier: GPL-3.0-or-later
;;; Copyright © 2026 Hilton Chain <hako@ultrarare.space>
(define-module (rosenthal packages linux)
;; Guile builtins
#:use-module (ice-9 match)
#:use-module (ice-9 regex)
;; Utilities
#:use-module (guix gexp)
#:use-module (guix packages)
#:use-module (guix utils)
;; Guix origin methods
#:use-module (guix download)
#:use-module (guix git-download)
;; Guix packages
#:use-module (gnu packages linux)
#:export (default-initrd-configs
cachyos-configs))
(define* (default-initrd-configs
#:optional
(system (or (%current-target-system)
(%current-system))))
"Kernel configurations required by 'default-linux-libre-initrd-modules'."
`("CONFIG_NLS_ISO8859_1=m"
"CONFIG_CRYPTO_SERPENT=m"
"CONFIG_CRYPTO_WP512=m"
"CONFIG_DM_CRYPT=m"
"CONFIG_BLK_DEV_NVME=m"
"CONFIG_MMC_BLOCK=m"
"CONFIG_SATA_AHCI=m"
"CONFIG_USB_STORAGE=m"
"CONFIG_USB_UAS=m"
,@(if (string-match "^(x86_64|i[3-6]86)-" system)
'("CONFIG_PATA_ACPI=m"
"CONFIG_PATA_ATIIXP=m"
"CONFIG_SCSI_ISCI=m")
'())
"CONFIG_HW_RANDOM_VIRTIO=m"
"CONFIG_SCSI_VIRTIO=m"
"CONFIG_VIRTIO_BALLOON=m"
"CONFIG_VIRTIO_BLK=m"
"CONFIG_VIRTIO_CONSOLE=m"
"CONFIG_VIRTIO_MMIO=m"
"CONFIG_VIRTIO_NET=m"
"CONFIG_VIRTIO_PCI=m"
"CONFIG_HID_GENERIC=m"
"CONFIG_USB_HID=m"
,@(if (target-riscv64? system)
'()
'("CONFIG_HID_APPLE=m"))))
;;;
;;; linux-cachyos
;;; https://github.com/CachyOS/linux-cachyos
;;;
(define* (cachyos-configs #:key (major-version "6")
cachy-config?
cpusched
cc-harder?
per-gov?
tcp-bbr3?
HZ-ticks
tickrate
preempt
hugepage
processor-opt)
`(,@(match processor-opt
('generic
'("CONFIG_GENERIC_CPU=y"
"CONFIG_MZEN4"
"CONFIG_X86_NATIVE_CPU"))
('zen4
'("CONFIG_GENERIC_CPU"
"CONFIG_MZEN4=y"
"CONFIG_X86_NATIVE_CPU"))
('native
'("CONFIG_GENERIC_CPU"
"CONFIG_MZEN4"
"CONFIG_X86_NATIVE_CPU=y"))
(_ '()))
,@(if cachy-config?
'("CONFIG_CACHY=y")
'())
,@(match cpusched
((or 'cachyos 'bore 'hardened)
'("CONFIG_SCHED_BORE=y"))
('bmq
'("CONFIG_SCHED_ALT=y"
"CONFIG_SCHED_BMQ=y"))
('eevdf
'())
('rt
'("CONFIG_PREEMPT_RT=y"))
('rt-bore
'("CONFIG_SCHED_BORE=y"
"CONFIG_PREEMPT_RT=y"))
(_ '()))
,@(match HZ-ticks
((or 100 250 500 600 750 1000)
`("CONFIG_HZ_300"
,(format #f "CONFIG_HZ_~a=y" HZ-ticks)
,(format #f "CONFIG_HZ=~a" HZ-ticks)))
(300
'("CONFIG_HZ_300=y"
"CONFIG_HZ=300"))
(_ '()))
,@(if per-gov?
'("CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL"
"CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y")
'())
,@(match tickrate
('periodic
'("CONFIG_NO_HZ_IDLE"
"CONFIG_NO_HZ_FULL"
"CONFIG_NO_HZ"
"CONFIG_NO_HZ_COMMON"
"CONFIG_HZ_PERIODIC=y"))
('idle
'("CONFIG_HZ_PERIODIC"
"CONFIG_NO_HZ_FULL"
"CONFIG_NO_HZ_IDLE=y"
"CONFIG_NO_HZ"
"CONFIG_NO_HZ_COMMON"))
('full
'("CONFIG_HZ_PERIODIC"
"CONFIG_NO_HZ_IDLE"
"CONFIG_CONTEXT_TRACKING_FORCE"
"CONFIG_NO_HZ_FULL=y"
"CONFIG_NO_HZ=y"
"CONFIG_NO_HZ_COMMON=y"
"CONFIG_CONTEXT_TRACKING=y")))
,@(if (not (member cpusched '(rt rt-bore)))
(if (version>=? major-version "7.0")
(match preempt
('full
'("CONFIG_PREEMPT=y"
"CONFIG_PREEMPT_LAZY"))
('lazy
'("CONFIG_PREEMPT"
"CONFIG_PREEMPT_LAZY=y"))
(_ '()))
(match preempt
('full
'("CONFIG_PREEMPT_DYNAMIC=y"
"CONFIG_PREEMPT=y"
"CONFIG_PREEMPT_VOLUNTARY"
"CONFIG_PREEMPT_LAZY"
"CONFIG_PREEMPT_NONE"))
('lazy
'("CONFIG_PREEMPT_DYNAMIC=y"
"CONFIG_PREEMPT"
"CONFIG_PREEMPT_VOLUNTARY"
"CONFIG_PREEMPT_LAZY=y"
"CONFIG_PREEMPT_NONE"))
('voluntary
'("CONFIG_PREEMPT_DYNAMIC"
"CONFIG_PREEMPT=y"
"CONFIG_PREEMPT_VOLUNTARY=y"
"CONFIG_PREEMPT_LAZY"
"CONFIG_PREEMPT_NONE"))
('none
'("CONFIG_PREEMPT_DYNAMIC"
"CONFIG_PREEMPT"
"CONFIG_PREEMPT_VOLUNTARY"
"CONFIG_PREEMPT_LAZY"
"CONFIG_PREEMPT_NONE=y"))
(_ '())))
'())
,@(if cc-harder?
'("CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE"
"CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y")
'())
,@(if tcp-bbr3?
'("CONFIG_TCP_CONG_CUBIC=m"
"CONFIG_DEFAULT_CUBIC"
"CONFIG_TCP_CONG_BBR=y"
"CONFIG_DEFAULT_BBR=y"
"CONFIG_DEFAULT_TCP_CONG=\"bbr\""
"CONFIG_NET_SCH_FQ_CODEL=m"
"CONFIG_NET_SCH_FQ=y"
"CONFIG_DEFAULT_FQ_CODEL"
"CONFIG_DEFAULT_FQ=y")
'())
,@(match hugepage
('always
'("CONFIG_TRANSPARENT_HUGEPAGE_MADVISE"
"CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y"))
('madvise
'("CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS"
"CONFIG_TRANSPARENT_HUGEPAGE_MADVISE=y"))
(_ '()))
,@(if (version>=? major-version "7.0")
'()
'("CONFIG_USER_NS=y"))))
(define (%kernel-config path)
(let* ((commit "343874d509a9ff74729281fd297d8961dcedd342")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://codeberg.org/hako/kernel-config.git")
(commit commit)))
(file-name (string-append "kernel-config." (string-take commit 7)))
(sha256
(base32 "150nms11b9cdp051i7xn4x8vfj4izhhnmj0h5bj9gqk4fzxqz9n7")))))
(file-append source path)))
(define-public linux-cachyos-lts-server
(let* ((version "6.18.52-1")
(kernel
(customize-linux
#:name "linux-cachyos-lts-server"
#:source
(origin
(method url-fetch)
(uri (string-append
"https://github.com/CachyOS/linux/releases/download/cachyos-"
version "/cachyos-" version ".tar.gz"))
(sha256
(base32 "0m3rp34gfddjki662jv0mirig5rfa1chy5vfrvyzcsvvs26qpyrn")))
#:defconfig (%kernel-config "/defconfig_server")
#:configs
(string-join
(append (cachyos-configs
#:major-version (version-major version)
#:cachy-config? #f
#:cpusched 'eevdf
#:cc-harder? #t
#:per-gov? #f
#:tcp-bbr3? #t
#:HZ-ticks 300
#:tickrate 'full
#:preempt 'none
#:hugepage 'always
#:processor-opt 'generic)
(default-initrd-configs))
"\n"))))
(hidden-package
(package
(inherit kernel)
(version version)
(supported-systems '("x86_64-linux"))))))
(define-public linux-cachyos-bore-zen4
(let* ((version "7.2.8-1")
(kernel
(customize-linux
#:name "linux-cachyos-bore-zen4"
#:source
(origin
(method url-fetch)
(uri (string-append
"https://github.com/CachyOS/linux/releases/download/cachyos-"
version "/cachyos-" version ".tar.gz"))
(sha256
(base32 "0a7kxhivrp13j50scqqvb7bnsg0dcqing30q314imhsapm1dyj7q"))
(patches (map %kernel-config '("/patches/bore-cachy-7.2.patch"))))
#:defconfig (%kernel-config "/defconfig_desktop")
#:configs
(string-join
(append (cachyos-configs
#:major-version (version-major version)
#:cachy-config? #t
#:cpusched 'bore
#:cc-harder? #t
#:per-gov? #f
#:tcp-bbr3? #t
#:HZ-ticks 1000
#:tickrate 'full
#:preempt 'full
#:hugepage 'always
#:processor-opt 'zen4)
(default-initrd-configs))
"\n"))))
(hidden-package
(package
(inherit kernel)
(version version)
(supported-systems '("x86_64-linux"))))))
+124
View File
@@ -0,0 +1,124 @@
;;; SPDX-License-Identifier: GPL-3.0-or-later
;;; Copyright © 2026 Hilton Chain <hako@ultrarare.space>
(define-module (rosenthal utils others)
#:use-module (guix gexp)
#:use-module (rosenthal utils file)
#:use-module (gnu packages admin)
#:use-module (gnu packages base)
#:use-module (gnu packages compression)
#:use-module (gnu packages curl)
#:use-module (gnu packages file)
#:use-module (gnu packages gnupg)
#:use-module (gnu packages lsof)
#:use-module (gnu packages ncdu)
#:use-module (gnu packages ncurses)
#:use-module (gnu packages password-utils)
#:use-module (gnu packages rsync)
#:use-module (gnu packages rust-apps)
#:use-module (gnu packages ssh)
#:use-module (gnu packages sync)
#:use-module (gnu packages version-control)
#:use-module (gnu packages vim)
#:export (%rosenthal-guix-key-dorphine
%rosenthal-guix-key-nuporta
%rosenthal-guix-key-bocis
%rosenthal-guix-key-ignamma
%rosenthal-ssh-key-hako
%rosenthal-ssh-key-hako-deploy
%rosenthal-ssh-key-jonathan
%rosenthal-ssh-key-podiki
%rosenthal-network-manager-ipv6-privacy
%rosenthal-network-manager-random-mac-address
%rosenthal-cli-packages))
;;;
;;; Guix public keys
;;;
(define %rosenthal-guix-key-dorphine
(plain-file "dorphine.pub"
"(public-key (ecc (curve Ed25519)
(q #A279175682D0DAE3E11268E67E1F3FA47C38D7E509F7725567CF891E248E719F#)))"))
;; Nonguix head node.
(define %rosenthal-guix-key-nuporta
(plain-file "nuporta.pub"
"(public-key (ecc (curve Ed25519)
(q #C1FD53E5D4CE971933EC50C9F307AE2171A2D3B52C804642A7A35F84F3A4EA98#)))"))
;; aarch64-linux build worker.
(define %rosenthal-guix-key-bocis
(plain-file "bocis.pub"
"(public-key (ecc (curve Ed25519)
(q #7927EA1162184C1FAA62D20C111121A4604F00956E69F0FEB89EEE1721647897#)))"))
;; x86_64-linux + aarch64-linux build worker.
(define %rosenthal-guix-key-ignamma
(plain-file "ignamma.pub"
"(public-key (ecc (curve Ed25519)
(q #6FEEB15C4363F9975EB15C908EC911A4362E486DA642431FA2438C0B1C3D55F5#)))"))
;;;
;;; SSH public keys
;;;
(define %rosenthal-ssh-key-hako
(plain-file "hako.pub"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFcTj1N3cL/bh2Uvwh5/YubhZplPFnvGk/iVHQs3FWV2 openpgp:0x77671915\n"))
(define %rosenthal-ssh-key-hako-deploy
(plain-file "hako-deploy.pub"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMLWIp8y5/JGBaw+yFA5MFB5nlFpEx/tjc0q0Ij9KjTu\n"))
(define %rosenthal-ssh-key-jonathan
(plain-file "jonathan.pub"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHgzHvP3BRTIZ960LVglrK8w/C0+6Z5VM8/Q5Uwa0o+Z jonathan@3700X\n"))
(define %rosenthal-ssh-key-podiki
(plain-file "podiki.pub"
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDaSmW/3uq5L6ZP6gWmRw5RiTTg0es1PrbAo/x4vkPzwIKTrMFOCBCmcuH3vOCkEZJtNy3OpXbt/a3tDW+cc6dkeq2H4WpogQvyMTXreFS2phMgDTEXW2gGZIP6fA33CHERmhd9A/m0A+NH5KGAmLDQNK8QgPgIjZuseJYtYHNCnN2TCsWQYnbZtVQF5CS6iBUILpVp6p7QlSUokiCGaPjZfrjSFCm1hUPjJYSkv0NTq8TzyDfU2quqP7TBCj4WBi9HoW9+a8tN2TQ/+GYbGqlFljeNdz3vzItcHjidHOQL/42mpvzgZx7o7dtrqX9stp+mI3oBREYSD0bMyvND/dEBRWIbpFvbyYx/leMKq9yUcFNyI2lztk17ObaQkDLxlq4ClytgEtdbP6X0gua29FYK/YlAi13NptK6uy2xB2gsEIt5P4N3u+gZCNA0U3IVd7iMRSpg6PWiL1JguvhYSD5vGOnOjiXVlBCKn+ErTO9Ey/BZqwVBZMeDwynFnU1mYnkxtA+G54VI77gj24FrHw/ClOdJOdBUGAso9P3sFjdykkAJyKd4jiFzpDTOOJNs8qKhmFFzJBnJjn7nzwjElwOCZXdDKTrKqF/51WEqpNr8Za2QjRirV4m7n6FnyyD38b24InAVa+yze3qDI9yk2vjPdtFGCeLODSEjfV3U1z1hiw== cardno:11 465 639\n"))
;;;
;;; NetworkManager
;;;
(define %rosenthal-network-manager-ipv6-privacy
`("ip6-privacy.conf"
,(ini-file "ip6-privacy.conf"
'(("connection"
. (("ipv6.ip6-privacy" . 2)))))))
;; NOTE: When using on cloud machines, refer to the terms of the provider
;; first.
(define %rosenthal-network-manager-random-mac-address
`("random-mac-address.conf"
,(ini-file "random-mac-address.conf"
'(("connection-mac-randomization"
. (("ethernet.cloned-mac-address" . "stable")
("wifi.cloned-mac-address" . "stable")))))))
;;;
;;; Packages
;;;
(define %rosenthal-cli-packages
(list curl
file
git
`(,git "send-email")
glibc
gnupg
htop
mosh
ncurses
rclone
rsync
unzip
zip))