nixpkgs/nixos/modules/services/networking/keybase.nix

43 lines
776 B
Nix
Raw Normal View History

{ 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 08:50:29 +00:00
unitConfig.ConditionUser = "!@system";
serviceConfig = {
ExecStart = ''
${pkgs.keybase}/bin/keybase service --auto-forked
'';
Restart = "on-failure";
PrivateTmp = true;
};
2017-10-06 22:49:58 +00:00
wantedBy = [ "default.target" ];
};
environment.systemPackages = [ pkgs.keybase ];
};
}