diff --git a/hosts/by-name/moby/default.nix b/hosts/by-name/moby/default.nix index d0c02d338..394684e70 100644 --- a/hosts/by-name/moby/default.nix +++ b/hosts/by-name/moby/default.nix @@ -47,6 +47,8 @@ sane.programs.soundconverter.enableFor.user.colin = false; sane.programs.eg25-control.enableFor.user.colin = true; + sane.programs.dino.config.autostart = true; + # sane.programs.firefox.mime.priority = 300; # prefer other browsers when possible # HACK/TODO: make `programs.P.env.VAR` behave according to `mime.priority` # sane.programs.firefox.env = lib.mkForce {}; diff --git a/hosts/common/programs/dino.nix b/hosts/common/programs/dino.nix index d7a1f5295..638e1e564 100644 --- a/hosts/common/programs/dino.nix +++ b/hosts/common/programs/dino.nix @@ -9,7 +9,37 @@ # - ensure the other party is in your roster # - open a DM with the party # - click the phone icon at top (only visible if other party is in your roster) -{ ... }: +# +# dino can be autostarted on login -- useful to ensure that i always receive calls and notifications -- +# but at present it has no "start in tray" type of option: it must render a window. +{ config, lib, ... }: +let + cfg = config.sane.programs.dino; +in { - sane.programs.dino.persist.private = [ ".local/share/dino" ]; + sane.programs.dino = { + configOption = with lib; mkOption { + default = {}; + type = types.submodule { + options.autostart = mkOption { + type = types.bool; + default = false; + }; + }; + }; + + persist.private = [ ".local/share/dino" ]; + + services.dino = { + description = "auto-start and maintain dino XMPP connection"; + wantedBy = lib.mkIf cfg.config.autostart [ "default.target" ]; + serviceConfig = { + ExecStart = "${cfg.package}/bin/dino"; + Type = "simple"; + Restart = "always"; + RestartSec = "20s"; + }; + environment.G_MESSAGES_DEBUG = "all"; + }; + }; }