Skip to content

Commit 6238bbc

Browse files
authored
tailscale-systray: add module (#7821)
Added module for official Tailscale systray app
1 parent 173a29f commit 6238bbc

File tree

4 files changed

+77
-0
lines changed

4 files changed

+77
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{ lib, pkgs, ... }:
2+
3+
lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
4+
tailscale-systray-basic = ./basic.nix;
5+
}

0 commit comments

Comments
 (0)