regressed lab-tool to 0.10-dev to make it again
This commit is contained in:
parent
646c8bbc20
commit
2fdf7e4b0c
31 changed files with 732 additions and 635 deletions
35
packages/lab-tool/lab-old/config/config.scm
Normal file
35
packages/lab-tool/lab-old/config/config.scm
Normal file
|
@ -0,0 +1,35 @@
|
|||
;; lab/core/config.scm - Configuration functionality
|
||||
|
||||
(define-module (lab core config)
|
||||
#:use-module (ice-9 format)
|
||||
#:export (get-all-machines
|
||||
get-machine-config
|
||||
get-ssh-config
|
||||
get-homelab-root
|
||||
option-ref))
|
||||
|
||||
(define (option-ref options key default)
|
||||
"Get option value from options alist with default"
|
||||
(let ((value (assoc-ref options key)))
|
||||
(if value value default)))
|
||||
|
||||
(define (get-all-machines)
|
||||
"Get list of all machines"
|
||||
'(grey-area sleeper-service congenital-optimist reverse-proxy))
|
||||
|
||||
(define (get-machine-config machine-name)
|
||||
"Get configuration for a machine"
|
||||
`((services . (systemd ssh))
|
||||
(type . server)))
|
||||
|
||||
(define (get-ssh-config machine-name)
|
||||
"Get SSH configuration for a machine"
|
||||
(let ((hostname (symbol->string machine-name)))
|
||||
`((hostname . ,hostname)
|
||||
(user . "sma")
|
||||
(identity-file . "~/.ssh/id_ed25519_admin")
|
||||
(is-local . #f)))
|
||||
|
||||
(define (get-homelab-root)
|
||||
"Get home lab root directory"
|
||||
"/home/geir/Home-lab")
|
26
packages/lab-tool/lab-old/config/lab-auto-update.service
Normal file
26
packages/lab-tool/lab-old/config/lab-auto-update.service
Normal file
|
@ -0,0 +1,26 @@
|
|||
[Unit]
|
||||
Description=Home Lab Auto-Update Service
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=root
|
||||
WorkingDirectory=/home/geir/Home-lab
|
||||
ExecStart=/run/current-system/sw/bin/lab auto-update
|
||||
Environment=HOME=/root
|
||||
Environment=PATH=/run/current-system/sw/bin:/usr/bin:/bin
|
||||
|
||||
# Logging
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=lab-auto-update
|
||||
|
||||
# Security settings
|
||||
NoNewPrivileges=true
|
||||
ProtectSystem=false
|
||||
ProtectHome=false
|
||||
PrivateTmp=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Add table
Add a link
Reference in a new issue