2020-10-12 00:22:58 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.services.keybase;
|
|
|
|
|
2021-07-02 22:36:30 +00:00
|
|
|
in {
|
|
|
|
options.services.keybase.enable = mkEnableOption "Keybase";
|
2020-10-12 00:22:58 +00:00
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2021-11-04 16:42:44 +00:00
|
|
|
assertions = [
|
|
|
|
(lib.hm.assertions.assertPlatform "services.keybase" pkgs
|
|
|
|
lib.platforms.linux)
|
|
|
|
];
|
|
|
|
|
2020-10-12 00:22:58 +00:00
|
|
|
home.packages = [ pkgs.keybase ];
|
|
|
|
|
|
|
|
systemd.user.services.keybase = {
|
2021-07-02 22:36:30 +00:00
|
|
|
Unit.Description = "Keybase service";
|
2020-10-12 00:22:58 +00:00
|
|
|
|
|
|
|
Service = {
|
|
|
|
ExecStart = "${pkgs.keybase}/bin/keybase service --auto-forked";
|
|
|
|
Restart = "on-failure";
|
|
|
|
PrivateTmp = true;
|
|
|
|
};
|
|
|
|
|
2021-07-02 22:36:30 +00:00
|
|
|
Install.WantedBy = [ "default.target" ];
|
2020-10-12 00:22:58 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|