diff --git a/modules/services/flameshot.nix b/modules/services/flameshot.nix index 664f63fa..65954b13 100644 --- a/modules/services/flameshot.nix +++ b/modules/services/flameshot.nix @@ -39,10 +39,6 @@ in }; config = lib.mkIf cfg.enable { - assertions = [ - (lib.hm.assertions.assertPlatform "services.flameshot" pkgs lib.platforms.linux) - ]; - home.packages = [ cfg.package ]; xdg.configFile = lib.mkIf (cfg.settings != { }) { @@ -67,7 +63,7 @@ in Service = { Environment = [ "PATH=${config.home.profileDirectory}/bin" ]; - ExecStart = "${cfg.package}/bin/flameshot"; + ExecStart = lib.getExe cfg.package; Restart = "on-abort"; # Sandboxing. @@ -80,5 +76,18 @@ in SystemCallFilter = "@system-service"; }; }; + + launchd.agents.flameshot = { + enable = true; + config = { + ProgramArguments = [ (lib.getExe cfg.package) ]; + KeepAlive = { + Crashed = true; + SuccessfulExit = false; + }; + ProcessType = "Interactive"; + RunAtLoad = true; + }; + }; }; }