Remove n0emis as direct maintainer (#365023)
[NixPkgs.git] / nixos / modules / services / networking / keybase.nix
blob86868ef7c219f4704ed8a3a09a00fa95a99b00b5
2   config,
3   lib,
4   pkgs,
5   ...
6 }:
7 let
8   cfg = config.services.keybase;
9 in
12   ###### interface
14   options = {
16     services.keybase = {
18       enable = lib.mkOption {
19         type = lib.types.bool;
20         default = false;
21         description = "Whether to start the Keybase service.";
22       };
24     };
25   };
27   ###### implementation
29   config = lib.mkIf cfg.enable {
31     # Upstream: https://github.com/keybase/client/blob/master/packaging/linux/systemd/keybase.service
32     systemd.user.services.keybase = {
33       description = "Keybase service";
34       unitConfig.ConditionUser = "!@system";
35       environment.KEYBASE_SERVICE_TYPE = "systemd";
36       serviceConfig = {
37         Type = "notify";
38         EnvironmentFile = [
39           "-%E/keybase/keybase.autogen.env"
40           "-%E/keybase/keybase.env"
41         ];
42         ExecStart = "${pkgs.keybase}/bin/keybase service";
43         Restart = "on-failure";
44         PrivateTmp = true;
45       };
46       wantedBy = [ "default.target" ];
47     };
49     environment.systemPackages = [ pkgs.keybase ];
50   };