services: tailscale: Run with inherited environment variables.

* modules/rosenthal/services/networking.scm (tailscale-configuration)
[iptables]: Remove field.
(tailscale-shepherd-service): Remove configuration to environment variables.
This commit is contained in:
Hilton Chain 2025-10-25 15:48:36 +08:00
parent f4d7a54232
commit 0fa66ce699
No known key found for this signature in database
GPG Key ID: ACC66D09CA528292

View File

@ -107,10 +107,6 @@
(file-like tailscale) (file-like tailscale)
"The tailscale package to use.") "The tailscale package to use.")
(iptables
(file-like iptables-nft)
"The iptables package to use.")
(log-file (log-file
(string "/var/log/tailscaled.log") (string "/var/log/tailscaled.log")
"Path to log file.") "Path to log file.")
@ -141,32 +137,25 @@ to #f.")
(define tailscale-shepherd-service (define tailscale-shepherd-service
(match-record-lambda <tailscale-configuration> (match-record-lambda <tailscale-configuration>
(tailscale iptables log-file socket state-directory (tailscale log-file socket state-directory
upload-log? verbosity extra-options) upload-log? verbosity extra-options)
(let ((environment (list (shepherd-service
#~(list (string-append "PATH=" (documentation "Run tailscaled")
(string-join (provision '(tailscaled))
'(#$(file-append iptables "/sbin") (requirement '(user-processes))
#$(file-append iproute "/sbin")) (start
":"))))) #~(make-forkexec-constructor
(list (shepherd-service (list
(documentation "Run tailscaled") #$(file-append tailscale "/bin/tailscaled")
(provision '(tailscaled)) #$@(if upload-log?
(requirement '(user-processes)) '()
(start '("-no-logs-no-support"))
#~(make-forkexec-constructor "-socket" #$socket
(list "-statedir" #$state-directory
#$(file-append tailscale "/bin/tailscaled") "-verbose" #$(number->string verbosity)
#$@(if upload-log? #$@extra-options)
'() #:log-file #$log-file))
'("-no-logs-no-support")) (stop #~(make-kill-destructor))))))
"-socket" #$socket
"-statedir" #$state-directory
"-verbose" #$(number->string verbosity)
#$@extra-options)
#:environment-variables #$environment
#:log-file #$log-file))
(stop #~(make-kill-destructor)))))))
(define tailscale-service-type (define tailscale-service-type
(service-type (service-type