[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/07: hydra: milano: Add milano-guix-1 initial configuration.
From: |
Giovanni Biscuolo |
Subject: |
03/07: hydra: milano: Add milano-guix-1 initial configuration. |
Date: |
Tue, 4 Jun 2019 09:27:12 -0400 (EDT) |
biscuolo pushed a commit to branch wip-milano
in repository maintenance.
commit 615e07be2ac9fe65325ead147b119f2197fcd4af
Author: Giovanni Biscuolo <address@hidden>
Date: Tue May 21 16:41:07 2019 +0200
hydra: milano: Add milano-guix-1 initial configuration.
Still configuring this host, hopefully will a fully integrated offload build
node in GNU Guix infrastructure.
* hydra/milano-guix-1.scm: New file.
---
hydra/milano-guix-1.scm | 114 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 114 insertions(+)
diff --git a/hydra/milano-guix-1.scm b/hydra/milano-guix-1.scm
new file mode 100644
index 0000000..0a49ac2
--- /dev/null
+++ b/hydra/milano-guix-1.scm
@@ -0,0 +1,114 @@
+;; Guix System configuration for milano-guix-1.unimi.it build machine
+;; HP ProLiantDL380p Gen8
+;; Copyright © 2019 Giovanni Biscuolo <address@hidden>
+;; Released under the GNU GPLv3 or any later version.
+
+(use-modules (gnu))
+(use-service-modules networking mcron ssh)
+(use-package-modules screen ssh linux)
+
+;; The following definition are **almost** copied from dover.scm: a
+;; quick hack to have a(n almost) self contained config file
+
+;; FIXME: refactor using modules (e.g. like berlin.scm)
+
+(define (sysadmin name full-name)
+ (user-account
+ (name name)
+ (comment full-name)
+ (group "users")
+ (supplementary-groups '("wheel" "kvm"))
+ (home-directory (string-append "/home/" name))))
+
+(define %accounts
+ (list (sysadmin "ludo" "Ludovic Courtès")
+ (sysadmin "rekado" "Ricardo Wurmus")
+ (sysadmin "degrees380" "Giovanni Biscuolo")
+ (sysadmin "atrent" "Andrea Trentini")
+ (user-account
+ (name "hydra")
+ (comment "Hydra User")
+ (group "users")
+ (home-directory (string-append "/home/" name)))
+ (user-account
+ (name "bayfront")
+ (comment "Bayfront Offload")
+ (group "users")
+ (home-directory (string-append "/home/" name)))))
+
+(define %authorized-guix-keys
+ ;; List of authorized 'guix archive' keys.
+ (list (local-file "keys/guix/berlin.guixsd.org-export.pub")
+ (local-file "keys/guix/bayfront.guix.info-export.pub")))
+
+(define gc-job
+ ;; Run 'guix gc' at 3AM every day.
+ #~(job '(next-hour '(3)) "guix gc -F 50G"))
+
+(define btrfs-job
+ ;; Run 'btrfs balance' every three days to make free space.
+ #~(job (lambda (now)
+ (next-day-from now (range 1 31 3)))
+ (string-append #$btrfs-progs "/bin/btrfs balance "
+ "start -dusage=50 -musage=70 /")))
+
+;; The actual machine
+
+(operating-system
+ (locale "en_US.utf8")
+ (timezone "Europe/Rome")
+ (keyboard-layout
+ (keyboard-layout "it" "winkeys"))
+
+ (kernel-arguments '("vga=791"))
+
+ (initrd-modules (append (list "hpsa")
+ %base-initrd-modules))
+
+ (bootloader
+ (bootloader-configuration
+ (bootloader grub-bootloader)
+ (target "/dev/sda")
+ (keyboard-layout keyboard-layout)))
+
+ (file-systems
+ (cons* (file-system
+ (mount-point "/")
+ (device
+ (uuid "620115c7-89c7-4d79-a0bb-4957057d9991"))
+ (type "btrfs"))
+ %base-file-systems))
+
+ (swap-devices '("/dev/sda2"))
+
+ (host-name "milano-guix-1")
+
+ (users (append %accounts %base-user-accounts))
+
+ (packages (cons* btrfs-progs screen openssh strace %base-packages))
+
+ ;; Services
+ (services (append (list (service dhcp-client-service-type)
+
+ (service openssh-service-type
+ (openssh-configuration
+ (port-number 22)
+ (authorized-keys
+ `(("degrees380" ,(local-file
"keys/ssh/degrees380.pub"))
+ ("atrent" ,(local-file
"keys/ssh/atrent.pub"))
+ ("ludo" ,(local-file
"keys/ssh/ludo.pub"))
+ ("rekado" ,(local-file
"keys/ssh/rekado.pub"))))))
+
+ (service ntp-service-type)
+
+ (service mcron-service-type
+ (mcron-configuration
+ (jobs (list gc-job btrfs-job)))))
+
+ (modify-services %base-services
+ (guix-service-type config =>
+ (guix-configuration
+ (inherit config)
+ (use-substitutes? #f)
+ (authorized-keys
+ %authorized-guix-keys)))))))
- branch wip-milano created (now 600d5f0), Giovanni Biscuolo, 2019/06/04
- 07/07: hydra: milano: Add cbaines user as sysadmin, Giovanni Biscuolo, 2019/06/04
- 02/07: hydra: Add key for atrent, Giovanni Biscuolo, 2019/06/04
- 01/07: hydra: Add key for degrees380, Giovanni Biscuolo, 2019/06/04
- 05/07: hydra: milano: Add bayfront user ssh key to authorized-keys, Giovanni Biscuolo, 2019/06/04
- 04/07: hydra: milano: Add andreas as sysadmin, Giovanni Biscuolo, 2019/06/04
- 06/07: hydra: machines: Add milan-1 (nickname) to the database, Giovanni Biscuolo, 2019/06/04
- 03/07: hydra: milano: Add milano-guix-1 initial configuration.,
Giovanni Biscuolo <=