From efc80ff07e40fdc592dbd0983007221d3a97f687 Mon Sep 17 00:00:00 2001 From: "Collin J. Doering" Date: Sun, 5 Mar 2023 06:10:14 -0500 Subject: [PATCH] rekahsoft: Continue abstracting legacy vm's (#6 - ci0) * deploy/ci0-home-rekahsoft-ca.scm (rekahsoft): Adjust configuration to use proxmox-vm-legacy module * .guix/rekahsoft/guix-config/vms/ci0-home-rekahsoft-ca.scm (rekahsoft): Add deployment file for ci0 --- .../guix-config/vms/ci0-home-rekahsoft-ca.scm | 98 ++++--------------- deploy/ci0-home-rekahsoft-ca.scm | 14 +++ 2 files changed, 35 insertions(+), 77 deletions(-) create mode 100644 deploy/ci0-home-rekahsoft-ca.scm diff --git a/.guix/rekahsoft/guix-config/vms/ci0-home-rekahsoft-ca.scm b/.guix/rekahsoft/guix-config/vms/ci0-home-rekahsoft-ca.scm index 45752b3..4b47e49 100644 --- a/.guix/rekahsoft/guix-config/vms/ci0-home-rekahsoft-ca.scm +++ b/.guix/rekahsoft/guix-config/vms/ci0-home-rekahsoft-ca.scm @@ -1,83 +1,27 @@ (define-module (rekahsoft guix-config vms ci0-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 desktop) - #:use-module (gnu services networking) - #:use-module (gnu services ssh) - #:use-module (gnu services monitoring) #:use-module (gnu services docker) - #:use-module (gnu services xorg) - #:use-module (srfi srfi-1) - #:export (system)) + #:use-module (rekahsoft guix-config proxmox-vm-legacy) + #:export (%system)) -(define system +(define base-system (proxmox-vm-legacy "ci0")) + +(define %system (operating-system - (host-name "ci0") - (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 "/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 "collin.pub")) - ("root" ,(local-file "collin.pub")))))) - (service prometheus-node-exporter-service-type) - (service docker-service-type)) - (modify-services - (remove (lambda (service) - (eq? (service-kind service) gdm-service-type)) - %desktop-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" "docker")) + (home-directory "/home/collin")) + (operating-system-users base-system))) + (services + (append + (list (service docker-service-type)) + %proxmox-vm-legacy-services)))) diff --git a/deploy/ci0-home-rekahsoft-ca.scm b/deploy/ci0-home-rekahsoft-ca.scm new file mode 100644 index 0000000..7a1bada --- /dev/null +++ b/deploy/ci0-home-rekahsoft-ca.scm @@ -0,0 +1,14 @@ +(use-modules + (rekahsoft guix-config vms ci0-home-rekahsoft-ca)) + +(list + (machine + (operating-system %system) + (environment managed-host-environment-type) + (configuration (machine-ssh-configuration + (host-name "ci0.home.rekahsoft.ca") + (host-key "TODO") + (system "x86_64-linux") + (user "auto") + (identity ".deploy-key") + (port 22)))))