2017-05-22 02:14:12 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.services.keybase;
|
|
|
|
|
|
|
|
in {
|
|
|
|
|
|
|
|
###### interface
|
|
|
|
|
|
|
|
options = {
|
|
|
|
|
|
|
|
services.keybase = {
|
|
|
|
|
|
|
|
enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
description = "Whether to start the Keybase service.";
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
###### implementation
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
|
|
|
|
systemd.user.services.keybase = {
|
|
|
|
description = "Keybase service";
|
2017-10-23 10:50:29 +02:00
|
|
|
unitConfig.ConditionUser = "!@system";
|
2017-05-22 02:14:12 +02:00
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = ''
|
2017-11-03 19:41:06 +01:00
|
|
|
${pkgs.keybase}/bin/keybase service --auto-forked
|
2017-05-22 02:14:12 +02:00
|
|
|
'';
|
|
|
|
Restart = "on-failure";
|
|
|
|
PrivateTmp = true;
|
|
|
|
};
|
2017-10-07 00:49:58 +02:00
|
|
|
wantedBy = [ "default.target" ];
|
2017-05-22 02:14:12 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
environment.systemPackages = [ pkgs.keybase ];
|
|
|
|
};
|
|
|
|
}
|