lorri: add service

(cherry picked from commit 286dd9b308)

Fixes #944
This commit is contained in:
Tobias Happ 2019-11-16 22:05:08 +01:00 committed by Robert Helgesson
parent 5e7a4c55ed
commit b41fc9e6e8
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
3 changed files with 66 additions and 0 deletions

View file

@ -1207,6 +1207,13 @@ in
A new module is available: 'programs.rtorrent'.
'';
}
{
time = "2019-12-10T19:58:00+00:00";
message = ''
A new module is available: 'services.lorri'.
'';
}
];
};
}

View file

@ -114,6 +114,7 @@ let
(loadModule ./services/kdeconnect.nix { })
(loadModule ./services/keepassx.nix { })
(loadModule ./services/keybase.nix { })
(loadModule ./services/lorri.nix { condition = hostPlatform.isLinux; })
(loadModule ./services/mbsync.nix { })
(loadModule ./services/mpd.nix { })
(loadModule ./services/mpdris2.nix { condition = hostPlatform.isLinux; })

View file

@ -0,0 +1,58 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.lorri;
in
{
meta.maintainers = [ maintainers.gerschtli ];
options = {
services.lorri.enable = mkEnableOption "lorri build daemon";
};
config = mkIf cfg.enable {
home.packages = [ pkgs.lorri ];
systemd.user = {
services.lorri = {
Unit = {
Description = "lorri build daemon";
Requires = "lorri.socket";
After = "lorri.socket";
RefuseManualStart = true;
};
Service = {
ExecStart = "${pkgs.lorri}/bin/lorri daemon";
PrivateTmp = true;
ProtectSystem = "strict";
ProtectHome = "read-only";
Restart = "on-failure";
Environment =
let path = with pkgs; makeSearchPath "bin" [ nix gnutar gzip ];
in "PATH=${path}";
};
};
sockets.lorri = {
Unit = {
Description = "Socket for lorri build daemon";
};
Socket = {
ListenStream = "%t/lorri/daemon.socket";
RuntimeDirectory = "lorri";
};
Install = {
WantedBy = [ "sockets.target" ];
};
};
};
};
}