3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/nixos/modules/services/networking/keybase.nix
2017-10-24 16:30:11 +08:00

43 lines
779 B
Nix

{ 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";
unitConfig.ConditionUser = "!@system";
serviceConfig = {
ExecStart = ''
${pkgs.keybase}/bin/keybase -d service --auto-forked
'';
Restart = "on-failure";
PrivateTmp = true;
};
wantedBy = [ "default.target" ];
};
environment.systemPackages = [ pkgs.keybase ];
};
}