nix-config/home/gotify/default.nix

50 lines
1.0 KiB
Nix
Raw Permalink Normal View History

2022-01-18 09:32:55 +01:00
{ config, pkgs, ... }:
let
server_url = "gotify.monotremata.xyz";
server_port = "443";
client_token = "CToaKlqyMrBKJcp";
app_token = "AsMyhbR5h5ZlNXb";
default_priority = "5";
in
{
home.packages = [
pkgs.gotify-desktop
pkgs.gotify-cli
];
home.file.".config/gotify-desktop/config.toml".text = ''
[gotify]
url = "wss://${server_url}:${server_port}"
token = "${client_token}"
auto_delete = true
[notification]
min_priority = 1
'';
home.file.".config/gotify/cli.json".text = ''
{
"token": "${app_token}",
"url": "https://${server_url}",
"defaultPriority": ${default_priority}
}
'';
systemd.user.services.gotify = {
Unit = {
Description = "Gotify desktop";
After = [ "graphical-session-pre.target" ];
PartOf = [ "graphical-session.target" ];
};
Service = {
Type = "simple";
ExecStart = "${pkgs.gotify-desktop}/bin/gotify-desktop";
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
};
}