rekahsoft: Abstract legacy vm's (starting with searx0)
* .guix/rekahsoft/guix-config/proxmox-vm-legacy.scm (rekahsoft): New module that abstracts legacy vm's (postgres, searx0, my0, dash0, prom0). The exports of this module mimic the existing proxmox-vm-lvm-minimal module. * .guix/rekahsoft/guix-config/vms/searx0-home-rekahsoft-ca.scm (rekahsoft): Refactor to use newly added proxmox-vm-legacy module
This commit is contained in:
parent
30b86a67e9
commit
70c381aec5
|
@ -0,0 +1,28 @@
|
||||||
|
(define-module (rekahsoft guix-config proxmox-vm-legacy)
|
||||||
|
#:use-module (gnu)
|
||||||
|
#:use-module (gnu packages)
|
||||||
|
#:use-module (rekahsoft guix-config proxmox-vm-lvm-minimal)
|
||||||
|
#:export (%proxmox-vm-legacy-services
|
||||||
|
proxmox-vm-legacy))
|
||||||
|
|
||||||
|
(define %proxmox-vm-legacy-services %proxmox-vm-lvm-minimal-services)
|
||||||
|
|
||||||
|
;; "Legacy" vm's do not use lvm, but are all based on the same image (therefore, same root uuid)
|
||||||
|
(define (proxmox-vm-legacy host-name)
|
||||||
|
(let ((base-system (proxmox-vm-lvm-minimal host-name)))
|
||||||
|
(operating-system
|
||||||
|
(inherit base-system)
|
||||||
|
|
||||||
|
(file-systems
|
||||||
|
(cons* (file-system
|
||||||
|
(mount-point "/")
|
||||||
|
(device
|
||||||
|
(uuid "f354b908-fd6f-46c9-931b-2bebaac61b56"
|
||||||
|
'ext4))
|
||||||
|
(type "ext4"))
|
||||||
|
%base-file-systems))
|
||||||
|
|
||||||
|
(swap-devices
|
||||||
|
(list (swap-space (target "/dev/sda2"))))
|
||||||
|
|
||||||
|
(mapped-devices '()))))
|
|
@ -1,87 +1,27 @@
|
||||||
(define-module (rekahsoft guix-config vms searx0-home-rekahsoft-ca)
|
(define-module (rekahsoft guix-config vms searx0-home-rekahsoft-ca)
|
||||||
#:use-module (gnu)
|
#:use-module (gnu)
|
||||||
#:use-module (gnu system nss)
|
#:use-module (gnu system)
|
||||||
#:use-module (gnu packages)
|
|
||||||
#:use-module (gnu packages shells)
|
#:use-module (gnu packages shells)
|
||||||
#:use-module (gnu services desktop)
|
|
||||||
#:use-module (gnu services dbus)
|
|
||||||
#:use-module (gnu services networking)
|
|
||||||
#:use-module (gnu services ssh)
|
|
||||||
#:use-module (gnu services monitoring)
|
|
||||||
#:use-module (gnu services docker)
|
#:use-module (gnu services docker)
|
||||||
#:use-module (gnu services xorg)
|
#:use-module (rekahsoft guix-config proxmox-vm-legacy)
|
||||||
#:use-module (srfi srfi-1)
|
|
||||||
#:export (%system))
|
#:export (%system))
|
||||||
|
|
||||||
|
(define base-system (proxmox-vm-legacy "searx0"))
|
||||||
|
|
||||||
(define %system
|
(define %system
|
||||||
(operating-system
|
(operating-system
|
||||||
(host-name "searx0")
|
(inherit base-system)
|
||||||
(timezone "America/Toronto")
|
(users (cons*
|
||||||
(locale "en_US.utf8")
|
(user-account
|
||||||
(keyboard-layout (keyboard-layout "us"))
|
(name "collin")
|
||||||
|
(comment "Master User")
|
||||||
(bootloader
|
(group "users")
|
||||||
(bootloader-configuration
|
(shell #~(string-append #$zsh "/bin/zsh"))
|
||||||
(bootloader grub-bootloader)
|
(supplementary-groups
|
||||||
(targets '("/dev/sda"))
|
'("wheel" "netdev" "audio" "video" "docker"))
|
||||||
(keyboard-layout keyboard-layout)))
|
(home-directory "/home/collin"))
|
||||||
|
(operating-system-users base-system)))
|
||||||
(initrd-modules
|
(services
|
||||||
(append '("virtio_scsi") %base-initrd-modules))
|
(append
|
||||||
|
(list (service docker-service-type))
|
||||||
(swap-devices
|
%proxmox-vm-legacy-services))))
|
||||||
(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" "docker"))
|
|
||||||
(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"))))))
|
|
||||||
(service prometheus-node-exporter-service-type)
|
|
||||||
(service docker-service-type)
|
|
||||||
(dbus-service)
|
|
||||||
(elogind-service)
|
|
||||||
(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)))
|
|
||||||
|
|
Loading…
Reference in New Issue