fractal: launch on boot

This commit is contained in:
Colin 2023-10-02 06:12:24 +00:00
parent bbdc6f3aa9
commit 2de6c01262
3 changed files with 35 additions and 2 deletions

View File

@ -1,10 +1,23 @@
{ pkgs, ... }:
{ config, lib, pkgs, ... }:
let
cfg = config.sane.programs.fractal;
in
{
sane.programs.fractal = {
package = pkgs.fractal-nixified;
# package = pkgs.fractal-latest;
# package = pkgs.fractal-next;
configOption = with lib; mkOption {
default = {};
type = types.submodule {
options.autostart = mkOption {
type = types.bool;
default = true;
};
};
};
persist.private = [
# XXX by default fractal stores its state in ~/.local/share/<build-profile>/<UUID>.
".local/share/hack" # for debug-like builds
@ -12,5 +25,17 @@
];
suggestedPrograms = [ "gnome-keyring" ];
services.fractal = {
description = "auto-start and maintain fractal Matrix connection";
wantedBy = lib.mkIf cfg.config.autostart [ "default.target" ];
serviceConfig = {
ExecStart = "${cfg.package}/bin/fractal";
Type = "simple";
Restart = "always";
RestartSec = "20s";
};
# environment.G_MESSAGES_DEBUG = "all";
};
};
}

View File

@ -322,10 +322,17 @@ in
] ++ lib.optionals config.sane.programs.dino.config.autostart [
{
type = "toggle";
label = "jingle"; # XMPP calls
label = "XMPP"; # XMPP calls (jingle)
command = "${systemctl-toggle}/bin/systemctl-toggle --user dino";
active = "${pkgs.systemd}/bin/systemctl is-active --user dino";
}
] ++ lib.optionals config.sane.programs.fractal.config.autostart [
{
type = "toggle";
label = "Matrix"; # Matrix messages
command = "${systemctl-toggle}/bin/systemctl-toggle --user fractal";
active = "${pkgs.systemd}/bin/systemctl is-active --user fractal";
}
];
};
dnd = {

View File

@ -145,6 +145,7 @@ for_window [title="megapixels"] inhibit_idle open
# Dino (XMPP) is ordinarily started for the purpose of daemonizing (but still visible). keep it on a predictable, out-of-the-way workspace
# TODO: could be neat to somehow do this in a way that it never steals focus from anything...
for_window [app_id="im.dino.Dino"] move container to workspace number 1
for_window [app_id="org.gnome.Fractal"] move container to workspace number 1
### displays
## DESKTOP