diff options
| author | Daiderd Jordan <daiderd@gmail.com> | 2020-09-12 09:33:22 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-12 09:33:22 +0200 |
| commit | 62c14a1529379ba3bc8fdee41f4f6eae9f76d859 (patch) | |
| tree | 9041f10d18df67e84218b7be35bf1bbafc2a24c8 /modules | |
| parent | 28079f6d0fdd2a28dac267f5bc4d4c2f4903c814 (diff) | |
| parent | 1dbe3b71e334d4cf75e603e75e3f7ef40d973d91 (diff) | |
Merge pull request #222 from tricktron/lorri
Adds Lorri module
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/module-list.nix | 1 | ||||
| -rw-r--r-- | modules/services/lorri.nix | 46 |
2 files changed, 47 insertions, 0 deletions
diff --git a/modules/module-list.nix b/modules/module-list.nix index 52b987d..6375ea3 100644 --- a/modules/module-list.nix +++ b/modules/module-list.nix @@ -43,6 +43,7 @@ ./services/emacs.nix ./services/khd ./services/kwm + ./services/lorri.nix ./services/mail/offlineimap.nix ./services/mopidy.nix ./services/nix-daemon.nix diff --git a/modules/services/lorri.nix b/modules/services/lorri.nix new file mode 100644 index 0000000..354bcf4 --- /dev/null +++ b/modules/services/lorri.nix @@ -0,0 +1,46 @@ +{ 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 = null; + 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>. + ''; + }; + }; + }; + + 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; }; + }; + }; + }; +}
\ No newline at end of file |
