File tree Expand file tree Collapse file tree 4 files changed +77
-0
lines changed
tests/modules/services/tailscale-systray Expand file tree Collapse file tree 4 files changed +77
-0
lines changed Original file line number Diff line number Diff line change 1+ {
2+ time = "2025-09-17T05:03:26+00:00" ;
3+ condition = true ;
4+ message = ''
5+ A new service is available: 'services.tailscale-systray'.
6+ '' ;
7+ }
Original file line number Diff line number Diff line change 1+ {
2+ config ,
3+ lib ,
4+ pkgs ,
5+ ...
6+ } :
7+
8+ let
9+ cfg = config . services . tailscale-systray ;
10+ in
11+ {
12+ meta . maintainers = [ lib . maintainers . yethal ] ;
13+
14+ options . services . tailscale-systray = {
15+ enable = lib . mkEnableOption "Official Tailscale systray application for Linux" ;
16+
17+ package = lib . mkPackageOption pkgs "tailscale" { } ;
18+ } ;
19+
20+ config = lib . mkIf cfg . enable {
21+ assertions = [
22+ ( lib . hm . assertions . assertPlatform "services.tailscale-systray" pkgs lib . platforms . linux )
23+ {
24+ assertion = lib . versionAtLeast cfg . package . version "1.88.1" ;
25+ message = ''
26+ Tailscale systray is available since version 1.88.1
27+ '' ;
28+ }
29+ ] ;
30+
31+ systemd . user . services . tailscale-systray = {
32+ Unit = {
33+ Description = "Official Tailscale systray application for Linux" ;
34+ Requires = [ "tray.target" ] ;
35+ After = [
36+ "graphical-session.target"
37+ "tray.target"
38+ ] ;
39+ PartOf = [ "graphical-session.target" ] ;
40+ } ;
41+ Install = {
42+ WantedBy = [ "graphical-session.target" ] ;
43+ } ;
44+ Service . ExecStart = "${ lib . getExe cfg . package } systray" ;
45+ } ;
46+ } ;
47+ }
Original file line number Diff line number Diff line change 1+ { config , ... } :
2+ {
3+ services . tailscale-systray = {
4+ enable = true ;
5+ package = config . lib . test . mkStubPackage {
6+ name = "tailscale" ;
7+ version = "1.88.1" ;
8+ outPath = "@tailscale@" ;
9+ } ;
10+ } ;
11+
12+ nmt . script = ''
13+ serviceFile=home-files/.config/systemd/user/tailscale-systray.service
14+ assertFileExists $serviceFile
15+ assertFileRegex $serviceFile \
16+ '^ExecStart=@tailscale@/bin/tailscale systray$'
17+ '' ;
18+ }
Original file line number Diff line number Diff line change 1+ { lib , pkgs , ... } :
2+
3+ lib . optionalAttrs pkgs . stdenv . hostPlatform . isLinux {
4+ tailscale-systray-basic = ./basic.nix ;
5+ }
You can’t perform that action at this time.
0 commit comments