mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
47 lines
1.1 KiB
Nix
47 lines
1.1 KiB
Nix
{
|
|
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";
|
|
};
|
|
};
|
|
}
|