mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-14 04:51:08 +01:00
trayscale: add module
Trayscale is an unofficial GUI wrapper around the Tailscale CLI client. PR #5803
This commit is contained in:
parent
daaf0c2f8d
commit
4c8647b1ed
8 changed files with 93 additions and 0 deletions
39
modules/services/trayscale.nix
Normal file
39
modules/services/trayscale.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let cfg = config.services.trayscale;
|
||||
in {
|
||||
meta.maintainers = [ lib.hm.maintainers.callumio ];
|
||||
|
||||
options.services.trayscale = {
|
||||
enable = lib.mkEnableOption
|
||||
"An unofficial GUI wrapper around the Tailscale CLI client.";
|
||||
|
||||
package = lib.mkPackageOption pkgs "trayscale" { };
|
||||
|
||||
hideWindow = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Whether to hide the trayscale window on startup.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.trayscale" pkgs
|
||||
lib.platforms.linux)
|
||||
];
|
||||
|
||||
systemd.user.services.trayscale = {
|
||||
Unit = {
|
||||
Description =
|
||||
"An unofficial GUI wrapper around the Tailscale CLI client";
|
||||
Requires = [ "tray.target" ];
|
||||
After = [ "graphical-session-pre.target" "tray.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
};
|
||||
Install = { WantedBy = [ "graphical-session.target" ]; };
|
||||
Service.ExecStart = toString ([ "${cfg.package}/bin/trayscale" ]
|
||||
++ lib.optional cfg.hideWindow "--hide-window");
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue