vuls: init at 0.27.0
[NixPkgs.git] / nixos / modules / services / networking / keybase.nix
blob9bb7ad3844a068ac47099d13f0bddb1cb614278b
1 { config, lib, pkgs, ... }:
2 let
3   cfg = config.services.keybase;
4 in {
6   ###### interface
8   options = {
10     services.keybase = {
12       enable = lib.mkOption {
13         type = lib.types.bool;
14         default = false;
15         description = "Whether to start the Keybase service.";
16       };
18     };
19   };
21   ###### implementation
23   config = lib.mkIf cfg.enable {
25     # Upstream: https://github.com/keybase/client/blob/master/packaging/linux/systemd/keybase.service
26     systemd.user.services.keybase = {
27       description = "Keybase service";
28       unitConfig.ConditionUser = "!@system";
29       environment.KEYBASE_SERVICE_TYPE = "systemd";
30       serviceConfig = {
31         Type = "notify";
32         EnvironmentFile = [
33           "-%E/keybase/keybase.autogen.env"
34           "-%E/keybase/keybase.env"
35         ];
36         ExecStart = "${pkgs.keybase}/bin/keybase service";
37         Restart = "on-failure";
38         PrivateTmp = true;
39       };
40       wantedBy = [ "default.target" ];
41     };
43     environment.systemPackages = [ pkgs.keybase ];
44   };