mirror of
https://github.com/nix-community/home-manager
synced 2024-12-05 01:19:46 +01:00
8d663335eb
Fixes https://github.com/target/lorri/issues/255 when the service is
installed through home-manager.
PR #975
(cherry picked from commit 0fce533e70
)
58 lines
1.2 KiB
Nix
58 lines
1.2 KiB
Nix
{ 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 gitMinimal 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" ];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|