Compare commits

..

No commits in common. "1b87867f0024bea0653edf1f47ed449b9511b521" and "f4d7a54232f304e66684e8460d5e0adc4bd6532f" have entirely different histories.

2 changed files with 29 additions and 38 deletions

View File

@ -319,26 +319,6 @@ a SOCKS5 proxy.")
"derpprobe" "derpprobe"
"tailscaled" "tailscaled"
"tsidp"))))) "tsidp")))))
(add-after 'unpack 'fix-paths
(lambda _
(substitute* "ssh/tailssh/user.go"
(((format #f "(\")(~a|~a\")"
(string-join
'("/usr/local/sbin"
"/usr/local/bin"
"/usr/sbin"
"/usr/bin"
"/sbin"
"/bin")
":")
(string-join
'("/usr/local/bin"
"/usr/bin"
"/bin")
":"))
_ prefix suffix)
(format #f "~a/run/current-system/profile/bin:~a"
prefix suffix)))))
(add-after 'install 'install-extras (add-after 'install 'install-extras
(lambda _ (lambda _
(symlink (in-vicinity #$output "bin/tailscaled") (symlink (in-vicinity #$output "bin/tailscaled")

View File

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