mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
tailscale-systray: add module (#7821)
Added module for official Tailscale systray app
This commit is contained in:
parent
173a29f735
commit
6238bbc0ae
4 changed files with 77 additions and 0 deletions
7
modules/misc/news/2025/09/2025-09-17_07-03-26.nix
Normal file
7
modules/misc/news/2025/09/2025-09-17_07-03-26.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
time = "2025-09-17T05:03:26+00:00";
|
||||
condition = true;
|
||||
message = ''
|
||||
A new service is available: 'services.tailscale-systray'.
|
||||
'';
|
||||
}
|
||||
47
modules/services/tailscale-systray.nix
Normal file
47
modules/services/tailscale-systray.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
}
|
||||
18
tests/modules/services/tailscale-systray/basic.nix
Normal file
18
tests/modules/services/tailscale-systray/basic.nix
Normal 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$'
|
||||
'';
|
||||
}
|
||||
5
tests/modules/services/tailscale-systray/default.nix
Normal file
5
tests/modules/services/tailscale-systray/default.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{ lib, pkgs, ... }:
|
||||
|
||||
lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
|
||||
tailscale-systray-basic = ./basic.nix;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue