From 2b3e338e0ddcc4db8c839685a302e3efab264764 Mon Sep 17 00:00:00 2001 From: "Collin J. Doering" Date: Sat, 4 Mar 2023 18:51:59 -0500 Subject: [PATCH] rekahsoft: Continue abstracting legacy vm's (#4 - dash0) * deploy/dash0-home-rekahsoft-ca.scm (rekahsoft): Adjust configuration to use proxmox-vm-legacy module * .guix/rekahsoft/guix-config/vms/dash0-home-rekahsoft-ca.scm (rekahsoft): Add deployment file for dash0 --- .../vms/dash0-home-rekahsoft-ca.scm | 96 ++++--------------- deploy/dash0-home-rekahsoft-ca.scm | 14 +++ 2 files changed, 33 insertions(+), 77 deletions(-) create mode 100644 deploy/dash0-home-rekahsoft-ca.scm diff --git a/.guix/rekahsoft/guix-config/vms/dash0-home-rekahsoft-ca.scm b/.guix/rekahsoft/guix-config/vms/dash0-home-rekahsoft-ca.scm index 00a4ead..3e58baf 100644 --- a/.guix/rekahsoft/guix-config/vms/dash0-home-rekahsoft-ca.scm +++ b/.guix/rekahsoft/guix-config/vms/dash0-home-rekahsoft-ca.scm @@ -1,85 +1,27 @@ (define-module (rekahsoft guix-config vms dash0-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 dbus) - #:use-module (gnu services networking) - #:use-module (gnu services ssh) #:use-module (gnu services docker) - #: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 "dash0")) + (define %system (operating-system - (host-name "dash0") - (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" "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 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))) + (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/dash0-home-rekahsoft-ca.scm b/deploy/dash0-home-rekahsoft-ca.scm new file mode 100644 index 0000000..9587e8b --- /dev/null +++ b/deploy/dash0-home-rekahsoft-ca.scm @@ -0,0 +1,14 @@ +(use-modules + (rekahsoft guix-config vms dash0-home-rekahsoft-ca)) + +(list + (machine + (operating-system %system) + (environment managed-host-environment-type) + (configuration (machine-ssh-configuration + (host-name "dash0.home.rekahsoft.ca") + (host-key "TODO") + (system "x86_64-linux") + (user "auto") + (identity ".deploy-key") + (port 22)))))