From 21ead4bff50f058bfdecdcbb5bda6965a756ed93 Mon Sep 17 00:00:00 2001 From: Timo Wilken Date: Sun, 22 Jan 2023 22:34:59 +0100 Subject: Extract common server packages and services This should improve maintainability a bit by combining common services running on the servers. Additionally, this parameterises common parts by servers' host names instead of the host-name-like symbols as before. --- tw/system/vin.scm | 45 ++------------------------------------------- 1 file changed, 2 insertions(+), 43 deletions(-) (limited to 'tw/system/vin.scm') diff --git a/tw/system/vin.scm b/tw/system/vin.scm index c3e6ab16..ddecc127 100644 --- a/tw/system/vin.scm +++ b/tw/system/vin.scm @@ -6,9 +6,6 @@ #:use-module (guix gexp) #:use-module (tw system common)) -(use-package-modules admin bash certs databases linux man rsync shells video) -(use-service-modules mcron monitoring networking pm ssh vpn) - ;; The device's BIOS does not support UEFI, sadly. It also doesn't recognise ;; NVME devices, so we can only use SATA hard disks, not the M.2 SSD. ;; /dev/sda1 is the https://en.wikipedia.org/wiki/BIOS_boot_partition for grub. @@ -40,49 +37,11 @@ ;; Packages installed system-wide. Users can also install packages ;; under their own account: use 'guix search KEYWORD' to search ;; for packages and 'guix install PACKAGE' to install a package. - (packages - (append (list - ;; For eventual backup scripts? - btrfs-progs rsync) - %common-system-packages - %base-packages)) + (packages %base-system-packages) ;; Below is the list of system services. To search for available ;; services, run 'guix system search KEYWORD' in a terminal. - (services - (append - (list (service openssh-service-type - (openssh-configuration - (port-number 22022) - (password-authentication? #f) - (accepted-environment '("LANG" "LC_*")) - (authorized-keys - `(("timo" ,(local-file "files/timo.pub")))))) - - (service dhcp-client-service-type) - - (service ntp-service-type) - - (simple-service 'cronjobs mcron-service-type - (list #~(job "0 21 * * *" "guix gc -d 2w -F 25G") - #~(job "0 22 * * *" ; after guix gc - (string-append #$(file-append util-linux "/sbin/fstrim") - " --fstab --verbose")))) - - ;; Prometheus node exporter - (service prometheus-node-exporter-service-type - (prometheus-node-exporter-configuration - (web-listen-address "10.0.0.3:9100"))) - - (wireguard-service 'vin)) - - (modify-services %base-services - (login-service-type - config => - (login-configuration - (inherit config) - (motd (plain-file "no-motd" "")) - (allow-empty-passwords? #f)))))) + (services (server-base-services host-name)) ;; The list of user accounts ('root' is implicit). (users %server-base-user-accounts) -- cgit v1.2.3