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