aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vps.scm253
1 files changed, 128 insertions, 125 deletions
diff --git a/vps.scm b/vps.scm
index 259ec80..069270c 100644
--- a/vps.scm
+++ b/vps.scm
@@ -344,129 +344,132 @@ pki " mail-domain " key \"" (tls-priv-for mail-domain) "\"")))
(substitute* "lib/cgit/filters/about-formatting.sh"
(("txt2html") "md2html"))))))))))
-(operating-system
- (locale "en_US.UTF-8")
- (timezone "America/Sao_Paulo")
- (keyboard-layout (keyboard-layout "us"))
- (host-name "guix-pet-server")
- (users (cons* (user-account
- (name user)
- (group "users")
- (home-directory (string-append "/home/" user))
- (supplementary-groups '("wheel")))
- %base-user-accounts))
- (sudoers-file (plain-file "sudoers" sudoers))
- (packages
- (append (map (compose list specification->package+output symbol->string)
- '(git
- nss-certs
- rsync))
- %base-packages))
- (services
- (append
- (list (service openssh-service-type
- (openssh-configuration
- (openssh openssh-sans-x)
- (password-authentication? #false)
- (authorized-keys
- `((,user ,(plain-file "id_rsa.pub" ssh-public-key))))))
- (service mcron-service-type
- (mcron-configuration
- (jobs (list generate-ci-html-job))))
- (simple-service 'automatic-services-restart
- activation-service-type
- (with-imported-modules '((gnu services herd))
- #~(begin
- (use-modules (gnu services herd))
- (restart-service 'mcron)
- (restart-service 'nginx))))
- (service unattended-upgrade-service-type)
- (service dhcp-client-service-type)
- (service opensmtpd-service-type
- (opensmtpd-configuration
- (config-file opensmtpd-config)))
- (service mail-aliases-service-type
- `(("postmaster" "root")
- ("webmaster" "root")
- ("abuse" "root")
- (,certbot-alias "root")))
- (service nginx-service-type
- (nginx-configuration
- (server-blocks
- (append
- (list
- (static-nginx-config (list ci-domain) "/srv/ci"))
- static-projects-nginx-config))))
- (service certbot-service-type
- (certbot-configuration
- (email (string-append certbot-alias "@" tld))
- (certificates
- (list
- (certificate-configuration
- (domains tls-domains))))))
- (simple-service 'automatic-certbot-renewal
- activation-service-type
- (with-imported-modules '((gnu services herd))
- #~(begin
- (use-modules (gnu services herd))
- (execl "/var/lib/certbot/renew-certificates")
- (restart-service 'nginx))))
- (service cgit-service-type
- (cgit-configuration
- (package cgit-with-custom-about-formatting)
- (remove-suffix? #t)
- (root-title "EuAndreh's repositories")
- (root-desc "Patches welcome!")
- (snapshots '("tar.gz" "zip"))
- (clone-prefix (list (string-append "https://" git-domain)))
- (source-filter (file-append cgit "/lib/cgit/filters/syntax-highlighting.py"))
- (about-filter (file-append cgit "/lib/cgit/filters/about-formatting.sh"))
- (favicon (file-append cgit "/share/cgit/favicon.ico"))
- (enable-commit-graph? #t)
- (enable-follow-links? #t)
- (enable-index-owner? #f)
- (enable-log-filecount? #t)
- (enable-log-linecount? #t)
- (enable-subject-links? #t)
- (enable-html-serving? #t)
- (enable-git-config? #t)
- (max-repodesc-length 120)
- (max-stats "year")
- (nocache? #t)
- (include
- (plain-file "euandreh-cgitrc"
- (string-join (map (partial string-append "readme=:README")
- '("" ".txt" ".md" ".rst"))
- "\n")))
- #;
- (nginx
- (nginx-server-configuration))))
- (simple-service 'init-srv-directories
- activation-service-type
- #~(for-each (lambda (p)
- (mkdir-p p)
- ;; error: cmd is undefined
- ;; #´chown -R $user users $p´
+(define my-system
+ (operating-system
+ (locale "en_US.UTF-8")
+ (timezone "America/Sao_Paulo")
+ (keyboard-layout (keyboard-layout "us"))
+ (host-name "guix-pet-server")
+ (users (cons* (user-account
+ (name user)
+ (group "users")
+ (home-directory (string-append "/home/" user))
+ (supplementary-groups '("wheel")))
+ %base-user-accounts))
+ (sudoers-file (plain-file "sudoers" sudoers))
+ (packages
+ (append (map (compose list specification->package+output symbol->string)
+ '(git
+ nss-certs
+ rsync))
+ %base-packages))
+ (services
+ (append
+ (list (service openssh-service-type
+ (openssh-configuration
+ (openssh openssh-sans-x)
+ (password-authentication? #false)
+ (authorized-keys
+ `((,user ,(plain-file "id_rsa.pub" ssh-public-key))))))
+ (service mcron-service-type
+ (mcron-configuration
+ (jobs (list generate-ci-html-job))))
+ (simple-service 'automatic-services-restart
+ activation-service-type
+ (with-imported-modules '((gnu services herd))
+ #~(begin
+ (use-modules (gnu services herd))
+ (restart-service 'mcron)
+ (restart-service 'nginx))))
+ (service unattended-upgrade-service-type)
+ (service dhcp-client-service-type)
+ (service opensmtpd-service-type
+ (opensmtpd-configuration
+ (config-file opensmtpd-config)))
+ (service mail-aliases-service-type
+ `(("postmaster" "root")
+ ("webmaster" "root")
+ ("abuse" "root")
+ (,certbot-alias "root")))
+ (service nginx-service-type
+ (nginx-configuration
+ (server-blocks
+ (append
+ (list
+ (static-nginx-config (list ci-domain) "/srv/ci"))
+ static-projects-nginx-config))))
+ (service certbot-service-type
+ (certbot-configuration
+ (email (string-append certbot-alias "@" tld))
+ (certificates
+ (list
+ (certificate-configuration
+ (domains tls-domains))))))
+ (simple-service 'automatic-certbot-renewal
+ activation-service-type
+ (with-imported-modules '((gnu services herd))
+ #~(begin
+ (use-modules (gnu services herd))
+ (execl "/var/lib/certbot/renew-certificates")
+ (restart-service 'nginx))))
+ (service cgit-service-type
+ (cgit-configuration
+ (package cgit-with-custom-about-formatting)
+ (remove-suffix? #t)
+ (root-title "EuAndreh's repositories")
+ (root-desc "Patches welcome!")
+ (snapshots '("tar.gz" "zip"))
+ (clone-prefix (list (string-append "https://" git-domain)))
+ (source-filter (file-append cgit "/lib/cgit/filters/syntax-highlighting.py"))
+ (about-filter (file-append cgit "/lib/cgit/filters/about-formatting.sh"))
+ (favicon (file-append cgit "/share/cgit/favicon.ico"))
+ (enable-commit-graph? #t)
+ (enable-follow-links? #t)
+ (enable-index-owner? #f)
+ (enable-log-filecount? #t)
+ (enable-log-linecount? #t)
+ (enable-subject-links? #t)
+ (enable-html-serving? #t)
+ (enable-git-config? #t)
+ (max-repodesc-length 120)
+ (max-stats "year")
+ (nocache? #t)
+ (include
+ (plain-file "euandreh-cgitrc"
+ (string-join (map (partial string-append "readme=:README")
+ '("" ".txt" ".md" ".rst"))
+ "\n")))
#;
- (chown p #$user "users")
- #;
- (chmod p #o755))
- '("/srv/http"
- "/srv/git"
- "/srv/ci"))))
- %base-services))
- (bootloader
- (bootloader-configuration
- (bootloader grub-bootloader)
- (target "/dev/vda")
- (keyboard-layout keyboard-layout)))
- (swap-devices
- (list (uuid "79a91c82-f3e1-4ed7-8c4e-23569f1ae0ca")))
- (file-systems
- (cons* (file-system
- (mount-point "/")
- (device
- (uuid "fddb6a4c-8b8c-4f57-b274-5d6d33200f28"
- 'ext4))
- (type "ext4"))
- %base-file-systems)))
+ (nginx
+ (nginx-server-configuration))))
+ (simple-service 'init-srv-directories
+ activation-service-type
+ #~(for-each (lambda (p)
+ (mkdir-p p)
+ ;; error: cmd is undefined
+ ;; #´chown -R $user users $p´
+ #;
+ (chown p #$user "users")
+ #;
+ (chmod p #o755))
+ '("/srv/http"
+ "/srv/git"
+ "/srv/ci"))))
+ %base-services))
+ (bootloader
+ (bootloader-configuration
+ (bootloader grub-bootloader)
+ (target "/dev/vda")
+ (keyboard-layout keyboard-layout)))
+ (swap-devices
+ (list (uuid "79a91c82-f3e1-4ed7-8c4e-23569f1ae0ca")))
+ (file-systems
+ (cons* (file-system
+ (mount-point "/")
+ (device
+ (uuid "fddb6a4c-8b8c-4f57-b274-5d6d33200f28"
+ 'ext4))
+ (type "ext4"))
+ %base-file-systems))))
+
+my-system