|
|
@ -149,9 +149,23 @@
|
|
|
|
(define list-of-strings?
|
|
|
|
(define list-of-strings?
|
|
|
|
(list-of string?))
|
|
|
|
(list-of string?))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(define-maybe/no-serialization string)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(define (file-like-pair? val)
|
|
|
|
|
|
|
|
(let ((name (car val))
|
|
|
|
|
|
|
|
(file (cdr val)))
|
|
|
|
|
|
|
|
(and (string? name) (file-like? file))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(define alist-of-file-like? (list-of file-like-pair?))
|
|
|
|
|
|
|
|
|
|
|
|
(define-configuration/no-serialization metznet-system-configuration
|
|
|
|
(define-configuration/no-serialization metznet-system-configuration
|
|
|
|
(certs (file-like le-certs)
|
|
|
|
(certs (file-like le-certs)
|
|
|
|
"certificate package")
|
|
|
|
"certificate package")
|
|
|
|
|
|
|
|
(vpn-pki-dir (maybe-string (let ((pki-dir (getenv "VPN_PKI_DIR")))
|
|
|
|
|
|
|
|
(or pki-dir
|
|
|
|
|
|
|
|
%unset-value)))
|
|
|
|
|
|
|
|
"openvpn pki directory")
|
|
|
|
|
|
|
|
(user-shells (alist-of-file-like (list (cons "/bin/zsh" zsh))) "user shells to link")
|
|
|
|
(channels-file (file-like (scheme-file
|
|
|
|
(channels-file (file-like (scheme-file
|
|
|
|
"channels.scm"
|
|
|
|
"channels.scm"
|
|
|
|
#~(append (list
|
|
|
|
#~(append (list
|
|
|
@ -186,19 +200,34 @@
|
|
|
|
(define (pam-mkhomedir-services configuration)
|
|
|
|
(define (pam-mkhomedir-services configuration)
|
|
|
|
(list (pam-mkhomedir-service configuration)))
|
|
|
|
(list (pam-mkhomedir-service configuration)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(define (shell-paths configuration)
|
|
|
|
|
|
|
|
(map car (metznet-system-configuration-user-shells configuration)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(define (shell-packages configuration)
|
|
|
|
|
|
|
|
(map cdr (metznet-system-configuration-user-shells configuration)))
|
|
|
|
|
|
|
|
|
|
|
|
(define (metznet-activation configuration)
|
|
|
|
(define (metznet-activation configuration)
|
|
|
|
#~(if (access? "/bin/zsh" F_OK)
|
|
|
|
#~(for-each
|
|
|
|
(display "zsh already linked")
|
|
|
|
(lambda
|
|
|
|
|
|
|
|
(path package)
|
|
|
|
(begin
|
|
|
|
(begin
|
|
|
|
(display "linking zsh")
|
|
|
|
(display path)
|
|
|
|
(symlink (string-append #$zsh "/bin/zsh") "/bin/zsh"))))
|
|
|
|
(display "\n")
|
|
|
|
|
|
|
|
(display package)
|
|
|
|
|
|
|
|
(display "\n")
|
|
|
|
|
|
|
|
(unless (access? path F_OK) (symlink (string-append package path) path))))
|
|
|
|
|
|
|
|
(list #$@(shell-paths configuration)) (list #$@(shell-packages configuration))))
|
|
|
|
|
|
|
|
|
|
|
|
(define (metznet-etc-service configuration)
|
|
|
|
(define (metznet-etc-service configuration)
|
|
|
|
`(("guix/channels.scm" ,(metznet-system-configuration-channels-file configuration))
|
|
|
|
(let ((channels-file (metznet-system-configuration-channels-file configuration))
|
|
|
|
("openvpn/ta.key" ,(local-file "ta.key"))
|
|
|
|
(pki-dir (metznet-system-configuration-vpn-pki-dir configuration)))
|
|
|
|
("openvpn/ca.crt" ,(local-file "ca.crt"))
|
|
|
|
(if (maybe-value-set? pki-dir)
|
|
|
|
("openvpn/client.crt" ,(local-file "client.crt"))
|
|
|
|
`(("guix/channels.scm" ,channels-file)
|
|
|
|
("openvpn/client.key" ,(local-file "client.key"))))
|
|
|
|
("openvpn/ta.key" ,(local-file (string-append pki-dir "/ta.key")))
|
|
|
|
|
|
|
|
("openvpn/ca.crt" ,(local-file (string-append pki-dir "/ca.crt")))
|
|
|
|
|
|
|
|
("openvpn/client.key" ,(local-file (string-append pki-dir "/client.key")))
|
|
|
|
|
|
|
|
("openvpn/client.crt" ,(local-file (string-append pki-dir "/client.crt"))))
|
|
|
|
|
|
|
|
`(("guix/channels.scm" ,channels-file)))))
|
|
|
|
|
|
|
|
|
|
|
|
(define metznet-service-type
|
|
|
|
(define metznet-service-type
|
|
|
|
(service-type (name 'metznet-service)
|
|
|
|
(service-type (name 'metznet-service)
|
|
|
|