mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 00:57:22 +01:00
fix[client]: stop anki from halting shutdown
This commit is contained in:
parent
723ce403b2
commit
8813fb5117
2 changed files with 40 additions and 28 deletions
|
|
@ -13555,38 +13555,45 @@ The `extraConfig` section here CANNOT be reindented. This has something to do wi
|
||||||
|
|
||||||
***** anki service for tray
|
***** anki service for tray
|
||||||
|
|
||||||
|
Sets up a systemd user service for anki that does not stall the shutdown process. Note that the outcommented =ExecStart= does not work because the home-manager anki package builds a separate anki package that - I think - cannot be referenced as no such expression exists in the module.
|
||||||
|
|
||||||
#+begin_src nix-ts :tangle modules/home/common/anki-tray.nix
|
#+begin_src nix-ts :tangle modules/home/common/anki-tray.nix
|
||||||
{ lib, config, ... }:
|
{ lib, config, ... }:
|
||||||
{
|
{
|
||||||
options.swarselmodules.anki-tray = lib.mkEnableOption "enable anki applet for tray";
|
options.swarselmodules.anki-tray = lib.mkEnableOption "enable anki applet for tray";
|
||||||
config = lib.mkIf config.swarselmodules.anki-tray {
|
config = lib.mkIf config.swarselmodules.anki-tray {
|
||||||
|
|
||||||
systemd.user.services.anki-applet = {
|
systemd.user.services.anki-applet = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Anki applet";
|
Description = "Anki applet";
|
||||||
Requires = [ "tray.target" ];
|
Requires = [ "tray.target" ];
|
||||||
After = [
|
After = [
|
||||||
"graphical-session.target"
|
"graphical-session.target"
|
||||||
"tray.target"
|
"tray.target"
|
||||||
];
|
];
|
||||||
PartOf = [ "graphical-session.target" ];
|
PartOf = [ "graphical-session.target" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
Install = {
|
Install = {
|
||||||
WantedBy = [ "graphical-session.target" ];
|
WantedBy = [ "graphical-session.target" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
# ExecStart = "${lib.getExe config.programs.anki.package}";
|
# ExecStart = "${lib.getExe config.programs.anki.package}";
|
||||||
ExecStart = "/etc/profiles/per-user/swarsel/bin/anki";
|
Type = "simple";
|
||||||
Environment = [
|
ExecStart = "/etc/profiles/per-user/${config.swarselsystems.mainUser}/bin/anki";
|
||||||
"QT_QPA_PLATFORM=xcb"
|
Environment = [
|
||||||
];
|
"QT_QPA_PLATFORM=xcb"
|
||||||
};
|
];
|
||||||
};
|
TimeoutStopSec = "2s";
|
||||||
|
KillMode = "mixed";
|
||||||
|
KillSignal = "SIGTERM";
|
||||||
|
SendSIGKILL = "yes";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
***** element service for tray
|
***** element service for tray
|
||||||
|
|
|
||||||
|
|
@ -20,10 +20,15 @@
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
# ExecStart = "${lib.getExe config.programs.anki.package}";
|
# ExecStart = "${lib.getExe config.programs.anki.package}";
|
||||||
ExecStart = "/etc/profiles/per-user/swarsel/bin/anki";
|
Type = "simple";
|
||||||
|
ExecStart = "/etc/profiles/per-user/${config.swarselsystems.mainUser}/bin/anki";
|
||||||
Environment = [
|
Environment = [
|
||||||
"QT_QPA_PLATFORM=xcb"
|
"QT_QPA_PLATFORM=xcb"
|
||||||
];
|
];
|
||||||
|
TimeoutStopSec = "2s";
|
||||||
|
KillMode = "mixed";
|
||||||
|
KillSignal = "SIGTERM";
|
||||||
|
SendSIGKILL = "yes";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue