[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/01: hydra: Add procedure berlin-build-machine-os.
From: |
Ricardo Wurmus |
Subject: |
01/01: hydra: Add procedure berlin-build-machine-os. |
Date: |
Thu, 24 Aug 2017 04:57:35 -0400 (EDT) |
rekado pushed a commit to branch master
in repository maintenance.
commit 5753635235ed0bea7bb9656b48feb8aae8d58aaf
Author: Ricardo Wurmus <address@hidden>
Date: Thu Aug 24 10:55:39 2017 +0200
hydra: Add procedure berlin-build-machine-os.
* hydra/modules/sysadmin/build-machines.scm (berlin-build-machine-os):
New procedure.
---
hydra/modules/sysadmin/build-machines.scm | 62 ++++++++++++++++++++++++++++++-
1 file changed, 61 insertions(+), 1 deletion(-)
diff --git a/hydra/modules/sysadmin/build-machines.scm
b/hydra/modules/sysadmin/build-machines.scm
index ad915d2..4a1bd68 100644
--- a/hydra/modules/sysadmin/build-machines.scm
+++ b/hydra/modules/sysadmin/build-machines.scm
@@ -1,6 +1,7 @@
;;; GNU Guix system administration tools.
;;;
;;; Copyright © 2016, 2017 Ludovic Courtès <address@hidden>
+;;; Copyright © 2017 Ricardo Wurmus <address@hidden>
;;;
;;; This program is free software: you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
@@ -23,7 +24,9 @@
#:use-module (gnu services networking)
#:use-module (guix gexp)
#:use-module (sysadmin people)
- #:export (build-machine-os))
+ #:use-module (guix packages ssh)
+ #:export (build-machine-os
+ berlin-build-machine-os))
;;; Commentary:
;;;
@@ -65,4 +68,61 @@ HOST-NAME and accessibly by SYSADMINS, with the given
AUTHORIZED-GUIX-KEYS."
(authorized-keys
authorized-guix-keys))))))))
+
+(define* (berlin-build-machine-os id sysadmins
+ #:key (authorized-guix-keys '()))
+ "Return the <operating-system> declaration for a build machine for
+berlin.guixsd.org with integer ID and accessibly by SYSADMINS, with
+the given AUTHORIZED-GUIX-KEYS."
+
+ (define gc-job
+ ;; Run 'guix gc' at 3AM every day.
+ #~(job '(next-hour '(3))
+ "guix gc -F 40G"))
+
+ (operating-system
+ (host-name (format #f "hydra-guix-~2,'0d" id))
+ (timezone "Europe/Berlin")
+ (locale "en_US.utf8")
+ (kernel-arguments '("console=tty0" "console=ttyS1,9600n8"))
+ (initrd (lambda (fs . args)
+ (apply base-initrd fs
+ #:extra-modules (list "sata_nv")
+ args)))
+ (bootloader (grub-configuration (device "/dev/sda")
+ (terminal-inputs '(serial))
+ (terminal-outputs '(serial))))
+ (file-systems (cons (file-system
+ (device "my-root")
+ (title 'label)
+ (mount-point "/")
+ (type "ext4"))
+ %base-file-systems))
+ (users (cons (user-account
+ (name "bi-admin")
+ (comment "Local admin")
+ (group "users")
+ (supplementary-groups '("wheel"))
+ (home-directory "/home/bi-admin"))
+ %base-user-accounts))
+
+ (packages (cons* openssh %base-packages))
+ (services (cons* (agetty-service (agetty-configuration
+ (tty "ttyS1")
+ (baud-rate "9600")))
+ (static-networking-service "enp0s8"
+ (format #f "192.168.0.~d" id)
+ #:netmask "255.255.255.0"
+ #:gateway "192.168.0.1")
+ (mcron-service (list gc-job))
+ (service sysadmin-service-type sysadmins)
+ (service openssh-service-type)
+ (modify-services %base-services
+ (guix-service-type config =>
+ (guix-configuration
+ (inherit config)
+ (use-substitutes? #f)
+ (authorized-keys
+ authorized-guix-keys))))))))
+
;;; build-machines.scm end here