Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions modules/misc/news/2025/09/2025-09-17_07-03-26.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
time = "2025-09-17T05:03:26+00:00";
condition = true;
message = ''
A new service is available: 'services.tailscale-systray'.
'';
}
47 changes: 47 additions & 0 deletions modules/services/tailscale-systray.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
config,
lib,
pkgs,
...
}:

let
cfg = config.services.tailscale-systray;
in
{
meta.maintainers = [ lib.maintainers.yethal ];

options.services.tailscale-systray = {
enable = lib.mkEnableOption "Official Tailscale systray application for Linux";

package = lib.mkPackageOption pkgs "tailscale" { };
};

config = lib.mkIf cfg.enable {
assertions = [
(lib.hm.assertions.assertPlatform "services.tailscale-systray" pkgs lib.platforms.linux)
{
assertion = lib.versionAtLeast cfg.package.version "1.88.1";
message = ''
Tailscale systray is available since version 1.88.1
'';
}
];

systemd.user.services.tailscale-systray = {
Unit = {
Description = "Official Tailscale systray application for Linux";
Requires = [ "tray.target" ];
After = [
"graphical-session.target"
"tray.target"
];
PartOf = [ "graphical-session.target" ];
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
Service.ExecStart = "${lib.getExe cfg.package} systray";
Comment thread
khaneliman marked this conversation as resolved.
};
};
}
18 changes: 18 additions & 0 deletions tests/modules/services/tailscale-systray/basic.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{ config, ... }:
{
services.tailscale-systray = {
enable = true;
Comment thread
khaneliman marked this conversation as resolved.
package = config.lib.test.mkStubPackage {
name = "tailscale";
version = "1.88.1";
Comment thread
Yethal marked this conversation as resolved.
outPath = "@tailscale@";
};
};

nmt.script = ''
serviceFile=home-files/.config/systemd/user/tailscale-systray.service
assertFileExists $serviceFile
assertFileRegex $serviceFile \
'^ExecStart=@tailscale@/bin/tailscale systray$'
'';
}
5 changes: 5 additions & 0 deletions tests/modules/services/tailscale-systray/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{ lib, pkgs, ... }:

lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
tailscale-systray-basic = ./basic.nix;
}