mirror of
https://github.com/nix-community/home-manager
synced 2024-11-10 07:04:17 +00: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
|
@ -587,4 +587,12 @@
|
|||
github = "zorrobert";
|
||||
githubId = 118135271;
|
||||
};
|
||||
callumio = {
|
||||
name = "Callum Leslie";
|
||||
email = "git+nix@cleslie.uk";
|
||||
github = "callumio";
|
||||
githubId = 16057677;
|
||||
keys =
|
||||
[{ fingerprint = "BC82 4BB5 1656 D144 285E A0EC D382 C4AF EECE AA90"; }];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1703,6 +1703,16 @@ in {
|
|||
one place. See https://github.com/glanceapp/glance for more.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2024-09-13T08:58:17+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.trayscale'.
|
||||
|
||||
An unofficial GUI wrapper around the Tailscale CLI client.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -374,6 +374,7 @@ let
|
|||
./services/tahoe-lafs.nix
|
||||
./services/taskwarrior-sync.nix
|
||||
./services/trayer.nix
|
||||
./services/trayscale.nix
|
||||
./services/twmn.nix
|
||||
./services/udiskie.nix
|
||||
./services/unclutter.nix
|
||||
|
|
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");
|
||||
};
|
||||
};
|
||||
}
|
|
@ -275,6 +275,7 @@ in import nmtSrc {
|
|||
./modules/services/sxhkd
|
||||
./modules/services/syncthing/linux
|
||||
./modules/services/trayer
|
||||
./modules/services/trayscale
|
||||
./modules/services/twmn
|
||||
./modules/services/udiskie
|
||||
./modules/services/window-managers/bspwm
|
||||
|
|
4
tests/modules/services/trayscale/default.nix
Normal file
4
tests/modules/services/trayscale/default.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
trayscale-show-window = ./show-window.nix;
|
||||
trayscale-hide-window = ./hide-window.nix;
|
||||
}
|
15
tests/modules/services/trayscale/hide-window.nix
Normal file
15
tests/modules/services/trayscale/hide-window.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ ... }: {
|
||||
services.trayscale = {
|
||||
enable = true;
|
||||
hideWindow = true;
|
||||
};
|
||||
|
||||
test.stubs = { trayscale = { }; };
|
||||
|
||||
nmt.script = ''
|
||||
serviceFile=home-files/.config/systemd/user/trayscale.service
|
||||
assertFileExists $serviceFile
|
||||
assertFileRegex $serviceFile \
|
||||
'^ExecStart=@trayscale@/bin/trayscale --hide-window$'
|
||||
'';
|
||||
}
|
15
tests/modules/services/trayscale/show-window.nix
Normal file
15
tests/modules/services/trayscale/show-window.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ ... }: {
|
||||
services.trayscale = {
|
||||
enable = true;
|
||||
hideWindow = false;
|
||||
};
|
||||
|
||||
test.stubs = { trayscale = { }; };
|
||||
|
||||
nmt.script = ''
|
||||
serviceFile=home-files/.config/systemd/user/trayscale.service
|
||||
assertFileExists $serviceFile
|
||||
assertFileRegex $serviceFile \
|
||||
'^ExecStart=@trayscale@/bin/trayscale$'
|
||||
'';
|
||||
}
|
Loading…
Reference in a new issue