1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 11:36:05 +01:00

tailscale-systray: add module (#7821)

Added module for official Tailscale systray app
This commit is contained in:
Yethal 2025-09-26 17:14:09 +02:00 committed by GitHub
parent 173a29f735
commit 6238bbc0ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 77 additions and 0 deletions

View file

@ -0,0 +1,7 @@
{
time = "2025-09-17T05:03:26+00:00";
condition = true;
message = ''
A new service is available: 'services.tailscale-systray'.
'';
}

View file

@ -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";
};
};
}

View file

@ -0,0 +1,18 @@
{ config, ... }:
{
services.tailscale-systray = {
enable = true;
package = config.lib.test.mkStubPackage {
name = "tailscale";
version = "1.88.1";
outPath = "@tailscale@";
};
};
nmt.script = ''
serviceFile=home-files/.config/systemd/user/tailscale-systray.service
assertFileExists $serviceFile
assertFileRegex $serviceFile \
'^ExecStart=@tailscale@/bin/tailscale systray$'
'';
}

View file

@ -0,0 +1,5 @@
{ lib, pkgs, ... }:
lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
tailscale-systray-basic = ./basic.nix;
}