mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-14 11:57:34 +00:00
46 lines
No EOL
1.3 KiB
Nix
46 lines
No EOL
1.3 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.services.lorri;
|
|
in
|
|
{
|
|
options = {
|
|
services.lorri = {
|
|
enable = mkOption {
|
|
type = types.bool;
|
|
default = false;
|
|
description = "Whether to enable the lorri service.";
|
|
};
|
|
|
|
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/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 = [ pkgs.lorri ];
|
|
launchd.user.agents.lorri = {
|
|
command = with pkgs; "${lorri}/bin/lorri daemon";
|
|
path = with pkgs; [ nix ];
|
|
serviceConfig = {
|
|
KeepAlive = true;
|
|
RunAtLoad = true;
|
|
ProcessType = "Background";
|
|
StandardOutPath = cfg.logFile;
|
|
StandardErrorPath = cfg.logFile;
|
|
EnvironmentVariables = { NIX_PATH = "nixpkgs=" + toString pkgs.path; };
|
|
};
|
|
};
|
|
};
|
|
} |