guix-machines/.guix/rekahsoft/guix-config/vms/postgres-home-rekahsoft-ca.scm

95 lines
2.7 KiB
Scheme

(define-module (rekahsoft guix-config vms postgres-home-rekahsoft-ca)
#:use-module (gnu)
#:use-module (gnu system nss)
#:use-module (gnu packages)
#:use-module (gnu packages shells)
#:use-module (gnu services networking)
#:use-module (gnu services ssh)
#:use-module (gnu services monitoring)
#:use-module (gnu services databases)
#:use-module (gnu services xorg)
#:use-module (srfi srfi-1)
#:export (system))
(define postgres-hba
(plain-file "pg_hba.conf"
"
local all all peer
host all all 127.0.0.1/32 md5
host all all ::1/128 md5
host all all 172.16.0.0/20 md5"))
(define system
(operating-system
(host-name "postgres")
(timezone "America/Toronto")
(locale "en_US.utf8")
(keyboard-layout (keyboard-layout "us"))
(bootloader
(bootloader-configuration
(bootloader grub-bootloader)
(target "/dev/sda")
(keyboard-layout keyboard-layout)))
(initrd-modules
(append '("virtio_scsi") %base-initrd-modules))
(swap-devices (list "/dev/sda2"))
(file-systems
(cons* (file-system
(mount-point "/")
(device
(uuid "f354b908-fd6f-46c9-931b-2bebaac61b56"
'ext4))
(type "ext4"))
%base-file-systems))
(users (cons (user-account
(name "collin")
(comment "Master User")
(group "users")
(shell #~(string-append #$zsh "/bin/zsh"))
(supplementary-groups
'("wheel" "netdev" "audio" "video"))
(home-directory "/home/collin"))
%base-user-accounts))
(packages
(append
(map specification->package
'("nss-certs"
"recutils"
"openssh"
"tmux"
"emacs"
"emacs-guix"))
%base-packages))
(services
(append
(list (service openssh-service-type
(openssh-configuration
(password-authentication? #f)
(authorized-keys
`(("collin" ,(local-file "collin.pub"))
("root" ,(local-file "collin.pub"))))))
(postgresql-service
#:config-file (postgresql-config-file
(hba-file postgres-hba)
(extra-config
'(("listen_addresses" "'*'")))))
(service prometheus-node-exporter-service-type)
(service network-manager-service-type)
(service wpa-supplicant-service-type))
(modify-services
%base-services
(guix-service-type
config => (guix-configuration
(inherit config)
(substitute-urls '("https://nexus.home.rekahsoft.ca/repository/guix")))))))
;; Allow resolution of '.local' host names with mDNS.
(name-service-switch %mdns-host-lookup-nss)))