diff options
| author | Thibault Gagnaux <thibault@gagnaux.ch> | 2020-08-29 16:32:49 +0200 |
|---|---|---|
| committer | Thibault Gagnaux <thibault@gagnaux.ch> | 2020-08-29 16:35:43 +0200 |
| commit | 30593350fd91f25b68bfa44cf5f948e481262258 (patch) | |
| tree | a9abb88c241dfc82be208c1cd60da286e3ee1047 /modules | |
| parent | 11413f94b2d5eb97756edcec6c7a7b4f9a46ae73 (diff) | |
Makes it work.
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/services/lorri.nix | 59 |
1 files changed, 23 insertions, 36 deletions
diff --git a/modules/services/lorri.nix b/modules/services/lorri.nix index 142f574..9e2dfd6 100644 --- a/modules/services/lorri.nix +++ b/modules/services/lorri.nix @@ -4,56 +4,43 @@ with lib; let cfg = config.services.lorri; + home = "${builtins.getEnv "HOME"}"; in { - options = { - services.lorri.enable = mkOption { - type = types.bool; - default = false; - description = "Whether to enable the lorri service."; - }; - - services.lorri.package = mkOption { - type = types.path; - default = pkgs.lorri; - defaultText = "pkgs.lorri"; - description = "This option specifies the lorri package to use."; - }; - - services.lorri.logFile = mkOption { - type = types.nullOr types.path; - default = "/var/tmp/lorri.log"; - example = "/var/tmp/lorri.log"; - description = '' - The logfile to use for the lorri service. Alternatively - <command>sudo launchctl debug system/org.nixos.lorri --stderr</command> - can be used to stream the logs to a shell after restarting the service with - <command>sudo launchctl kickstart -k system/org.nixos.lorri</command>. - ''; - }; + options = { + services.lorri = { + enable = mkOption { + type = types.bool; + default = false; + description = "Whether to enable the lorri service."; + }; - services.lorri.tempDir = mkOption { - type = types.nullOr types.path; - default = null; - description = "The TMPDIR to use for lorri."; + logFile = mkOption { + type = types.nullOr types.path; + default = "${home}/Library/Logs/lorri.log"; + example = "${home}/Library/Logs/lorri.log"; + description = '' + The logfile to use for the lorri service. Alternatively + <command>sudo launchctl debug system/com.target.lorri --stderr</command> + can be used to stream the logs to a shell after restarting the service with + <command>sudo launchctl kickstart -k system/com.target.lorri</command>. + ''; + }; }; }; config = mkIf cfg.enable { - environment.systemPackages = [ cfg.package ]; + environment.systemPackages = [ pkgs.lorri ]; launchd.user.agents.lorri = { serviceConfig = { + Label = "com.target.lorri"; + ProgramArguments = with pkgs; ["${zsh}/bin/zsh" "-c" "${lorri}/bin/lorri daemon"]; KeepAlive = true; + RunAtLoad = true; ProcessType = "Background"; - LowPriorityIO = false; StandardOutPath = cfg.logFile; StandardErrorPath = cfg.logFile; - EnvironmentVariables = mkMerge [ - config.nix.envVars - { TMPDIR = mkIf (cfg.tempDir != null) cfg.tempDir; } - ]; }; - command = "${cfg.package}/bin/lorri daemon"; }; }; }
\ No newline at end of file |
