format: remove exception for keybase and kbfs modules

This commit is contained in:
Sumner Evans 2021-04-26 12:16:25 -06:00 committed by Robert Helgesson
parent 5ae7817dc5
commit 55ef8d3a10
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
3 changed files with 18 additions and 38 deletions

2
format
View file

@ -36,8 +36,6 @@ find . -name '*.nix' \
! -path ./modules/programs/tmux.nix \
! -path ./modules/programs/zsh.nix \
! -path ./modules/services/gpg-agent.nix \
! -path ./modules/services/kbfs.nix \
! -path ./modules/services/keybase.nix \
! -path ./modules/services/mpd.nix \
! -path ./modules/services/sxhkd.nix \
! -path ./modules/systemd.nix \

View file

@ -6,9 +6,7 @@ let
cfg = config.services.kbfs;
in
{
in {
options = {
services.kbfs = {
enable = mkEnableOption "Keybase File System";
@ -24,11 +22,8 @@ in
extraFlags = mkOption {
type = types.listOf types.str;
default = [];
example = [
"-label kbfs"
"-mount-type normal"
];
default = [ ];
example = [ "-label kbfs" "-mount-type normal" ];
description = ''
Additional flags to pass to the Keybase filesystem on launch.
'';
@ -44,21 +39,18 @@ in
After = [ "keybase.service" ];
};
Service =
let
mountPoint = "\"%h/${cfg.mountPoint}\"";
in {
Environment = "PATH=/run/wrappers/bin KEYBASE_SYSTEMD=1";
ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p ${mountPoint}";
ExecStart ="${pkgs.kbfs}/bin/kbfsfuse ${toString cfg.extraFlags} ${mountPoint}";
ExecStopPost = "/run/wrappers/bin/fusermount -u ${mountPoint}";
Restart = "on-failure";
PrivateTmp = true;
};
Install = {
WantedBy = [ "default.target" ];
Service = let mountPoint = ''"%h/${cfg.mountPoint}"'';
in {
Environment = "PATH=/run/wrappers/bin KEYBASE_SYSTEMD=1";
ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p ${mountPoint}";
ExecStart =
"${pkgs.kbfs}/bin/kbfsfuse ${toString cfg.extraFlags} ${mountPoint}";
ExecStopPost = "/run/wrappers/bin/fusermount -u ${mountPoint}";
Restart = "on-failure";
PrivateTmp = true;
};
Install.WantedBy = [ "default.target" ];
};
home.packages = [ pkgs.kbfs ];

View file

@ -6,22 +6,14 @@ let
cfg = config.services.keybase;
in
{
options = {
services.keybase = {
enable = mkEnableOption "Keybase";
};
};
in {
options.services.keybase.enable = mkEnableOption "Keybase";
config = mkIf cfg.enable {
home.packages = [ pkgs.keybase ];
systemd.user.services.keybase = {
Unit = {
Description = "Keybase service";
};
Unit.Description = "Keybase service";
Service = {
ExecStart = "${pkgs.keybase}/bin/keybase service --auto-forked";
@ -29,9 +21,7 @@ in
PrivateTmp = true;
};
Install = {
WantedBy = [ "default.target" ];
};
Install.WantedBy = [ "default.target" ];
};
};
}