From 55ef8d3a109918e7eca4d8dcbcf1824a0e23c284 Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Mon, 26 Apr 2021 12:16:25 -0600 Subject: [PATCH] format: remove exception for keybase and kbfs modules --- format | 2 -- modules/services/kbfs.nix | 36 ++++++++++++++---------------------- modules/services/keybase.nix | 18 ++++-------------- 3 files changed, 18 insertions(+), 38 deletions(-) diff --git a/format b/format index 358a6401..5682a1f2 100755 --- a/format +++ b/format @@ -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 \ diff --git a/modules/services/kbfs.nix b/modules/services/kbfs.nix index 863f4fee..d4be2592 100644 --- a/modules/services/kbfs.nix +++ b/modules/services/kbfs.nix @@ -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 ]; diff --git a/modules/services/keybase.nix b/modules/services/keybase.nix index 2d0a06b0..0aec0bbc 100644 --- a/modules/services/keybase.nix +++ b/modules/services/keybase.nix @@ -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" ]; }; }; }