1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-26 00:18:30 +02:00

lorri: add service

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

View File

@ -1229,6 +1229,13 @@ in
it anymore.
'';
}
{
time = "2019-11-17T18:47:40+00:00";
message = ''
A new module is available: 'services.lorri'.
'';
}
];
};
}

View File

@ -115,6 +115,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" ];
};
};
};
};
}