overhaul hypr, waybar, add trayscale, etc

This commit is contained in:
Callum Leslie 2024-09-04 10:33:23 +01:00
parent af5a73e5df
commit 9bb638131b
Signed by: cleslie
GPG key ID: D382C4AFEECEAA90
12 changed files with 189 additions and 47 deletions

40
modules/trayscale.nix Normal file
View file

@ -0,0 +1,40 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.services.trayscale;
in {
options.services.trayscale = {
enable =
mkEnableOption
"An unofficial GUI wrapper around the Tailscale CLI client.";
package = mkPackageOption pkgs "trayscale" {};
hideWindow = mkOption {
description = "Whether to hide the trayscale window on startup.";
type = types.bool;
default = true;
};
};
config = mkIf cfg.enable {
assertions = [
(hm.assertions.assertPlatform "services.trayscale" pkgs 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"]
++ optional cfg.hideWindow "--hide-window");
};
};
}