parent
4e88906f41
commit
abe0da425b
|
@ -370,6 +370,7 @@
|
||||||
./services/network-filesystems/cachefilesd.nix
|
./services/network-filesystems/cachefilesd.nix
|
||||||
./services/network-filesystems/drbd.nix
|
./services/network-filesystems/drbd.nix
|
||||||
./services/network-filesystems/glusterfs.nix
|
./services/network-filesystems/glusterfs.nix
|
||||||
|
./services/network-filesystems/kbfs.nix
|
||||||
./services/network-filesystems/ipfs.nix
|
./services/network-filesystems/ipfs.nix
|
||||||
./services/network-filesystems/netatalk.nix
|
./services/network-filesystems/netatalk.nix
|
||||||
./services/network-filesystems/nfsd.nix
|
./services/network-filesystems/nfsd.nix
|
||||||
|
@ -431,6 +432,7 @@
|
||||||
./services/networking/iodine.nix
|
./services/networking/iodine.nix
|
||||||
./services/networking/ircd-hybrid/default.nix
|
./services/networking/ircd-hybrid/default.nix
|
||||||
./services/networking/keepalived/default.nix
|
./services/networking/keepalived/default.nix
|
||||||
|
./services/networking/keybase.nix
|
||||||
./services/networking/kippo.nix
|
./services/networking/kippo.nix
|
||||||
./services/networking/kresd.nix
|
./services/networking/kresd.nix
|
||||||
./services/networking/lambdabot.nix
|
./services/networking/lambdabot.nix
|
||||||
|
|
62
nixos/modules/services/network-filesystems/kbfs.nix
Normal file
62
nixos/modules/services/network-filesystems/kbfs.nix
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.services.kbfs;
|
||||||
|
|
||||||
|
in {
|
||||||
|
|
||||||
|
###### interface
|
||||||
|
|
||||||
|
options = {
|
||||||
|
|
||||||
|
services.kbfs = {
|
||||||
|
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Whether to mount the Keybase filesystem.";
|
||||||
|
};
|
||||||
|
|
||||||
|
mountPoint = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "%h/keybase";
|
||||||
|
example = "/keybase";
|
||||||
|
description = "Mountpoint for the Keybase filesystem.";
|
||||||
|
};
|
||||||
|
|
||||||
|
extraFlags = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = [];
|
||||||
|
example = [
|
||||||
|
"-label kbfs"
|
||||||
|
"-mount-type normal"
|
||||||
|
];
|
||||||
|
description = ''
|
||||||
|
Additional flags to pass to the Keybase filesystem on launch.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
###### implementation
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
|
systemd.user.services.kbfs = {
|
||||||
|
description = "Keybase File System";
|
||||||
|
requires = [ "keybase.service" ];
|
||||||
|
after = [ "keybase.service" ];
|
||||||
|
path = [ "/run/wrappers" ];
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p ${cfg.mountPoint}";
|
||||||
|
ExecStart = "${pkgs.kbfs}/bin/kbfsfuse ${toString cfg.extraFlags} ${cfg.mountPoint}";
|
||||||
|
ExecStopPost = "/run/wrappers/bin/fusermount -u ${cfg.mountPoint}";
|
||||||
|
Restart = "on-failure";
|
||||||
|
PrivateTmp = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.keybase.enable = true;
|
||||||
|
};
|
||||||
|
}
|
40
nixos/modules/services/networking/keybase.nix
Normal file
40
nixos/modules/services/networking/keybase.nix
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.services.keybase;
|
||||||
|
|
||||||
|
in {
|
||||||
|
|
||||||
|
###### interface
|
||||||
|
|
||||||
|
options = {
|
||||||
|
|
||||||
|
services.keybase = {
|
||||||
|
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Whether to start the Keybase service.";
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
###### implementation
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
|
systemd.user.services.keybase = {
|
||||||
|
description = "Keybase service";
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = ''
|
||||||
|
${pkgs.keybase}/bin/keybase service
|
||||||
|
'';
|
||||||
|
Restart = "on-failure";
|
||||||
|
PrivateTmp = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = [ pkgs.keybase ];
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue