rekahsoft: Continue abstracting legacy vm's (#6 - postgres)

* deploy/postgres-home-rekahsoft-ca.scm (rekahsoft): Adjust configuration to use
proxmox-vm-legacy module

* .guix/rekahsoft/guix-config/vms/postgres-home-rekahsoft-ca.scm (rekahsoft): Add deployment
file for postgres
This commit is contained in:
Collin J. Doering 2023-03-12 14:50:11 -04:00
parent 53a7edf4bc
commit 3433ea0c57
Signed by: rekahsoft
GPG Key ID: 7B4DEB93212B3022
2 changed files with 39 additions and 79 deletions

View File

@ -1,16 +1,13 @@
(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 system)
#: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)
#:use-module (rekahsoft guix-config proxmox-vm-legacy)
#:export (%system))
(define base-system (proxmox-vm-legacy "postgres"))
(define postgres-hba
(plain-file "pg_hba.conf"
"
@ -21,75 +18,24 @@ 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)
(targets '("/dev/sda"))
(keyboard-layout keyboard-layout)))
(initrd-modules
(append '("virtio_scsi") %base-initrd-modules))
(swap-devices
(list (swap-space (target "/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 "../../../../.pubkeys/collin.pub"))
("root" ,(local-file "../../../../.pubkeys/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)))
(inherit base-system)
(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"))
(operating-system-users base-system)))
(services
(append
(list (service postgresql-service-type
(postgresql-configuration
(postgresql postgresql-10)
(config-file (postgresql-config-file
(hba-file postgres-hba)
(extra-config
'(("listen_addresses" "'*'"))))))))
%proxmox-vm-legacy-services))))

View File

@ -0,0 +1,14 @@
(use-modules
(rekahsoft guix-config vms postgres-home-rekahsoft-ca))
(list
(machine
(operating-system %system)
(environment managed-host-environment-type)
(configuration (machine-ssh-configuration
(host-name "postgres.home.rekahsoft.ca")
(host-key "TODO")
(system "x86_64-linux")
(user "auto")
(identity ".deploy-key")
(port 22)))))