{pkgs, lib, config, ...}: with lib; let mkLauncher = import ../../packages/darwin-launcher.nix { inherit pkgs; }; lorriLauncher = mkLauncher '' source ${config.system.build.setEnvironment} exec ${pkgs.lorri}/bin/lorri daemon ''; in { options.services.my-lorri = { enable = mkEnableOption "Enable the lorri agent"; }; config = { launchd.user.agents.lorri = mkIf config.services.my-lorri.enable { serviceConfig = { ProgramArguments = [ "${lorriLauncher}" ]; RunAtLoad = true; KeepAlive = true; }; }; }; }