1 { config, lib, pkgs, ... }:
3 cfg = config.services.keybase;
12 enable = lib.mkOption {
13 type = lib.types.bool;
15 description = "Whether to start the Keybase service.";
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";
33 "-%E/keybase/keybase.autogen.env"
34 "-%E/keybase/keybase.env"
36 ExecStart = "${pkgs.keybase}/bin/keybase service";
37 Restart = "on-failure";
40 wantedBy = [ "default.target" ];
43 environment.systemPackages = [ pkgs.keybase ];