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/tmux.nix \
! -path ./modules/programs/zsh.nix \ ! -path ./modules/programs/zsh.nix \
! -path ./modules/services/gpg-agent.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/mpd.nix \
! -path ./modules/services/sxhkd.nix \ ! -path ./modules/services/sxhkd.nix \
! -path ./modules/systemd.nix \ ! -path ./modules/systemd.nix \

View File

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

View File

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