aboutsummaryrefslogtreecommitdiff
path: root/modules/services/cbatticon.nix
diff options
context:
space:
mode:
authorRobert Helgesson <robert@rycee.net>2020-02-02 00:39:17 +0100
committerRobert Helgesson <robert@rycee.net>2020-02-02 01:07:28 +0100
commit45abf3d38a2b51c00c347cab6950f3734e023bba (patch)
tree414fde5d14d1d075fa65e59175660fd1fb680c43 /modules/services/cbatticon.nix
parent9799d3de2d270a9c40fcf81d600bfd71088e144d (diff)
Apply `nixfmt` on many files
Diffstat (limited to 'modules/services/cbatticon.nix')
-rw-r--r--modules/services/cbatticon.nix52
1 files changed, 19 insertions, 33 deletions
diff --git a/modules/services/cbatticon.nix b/modules/services/cbatticon.nix
index 7bf3b70550d..0de69c5f9ec 100644
--- a/modules/services/cbatticon.nix
+++ b/modules/services/cbatticon.nix
@@ -9,37 +9,24 @@ let
package = pkgs.cbatticon;
makeCommand = commandName: commandArg:
- optional (commandArg != null) (
- let
- cmd = pkgs.writeShellScript commandName commandArg;
- in
- "--${commandName} ${cmd}"
- );
-
- commandLine = concatStringsSep " " (
- [ "${package}/bin/cbatticon" ]
+ optional (commandArg != null)
+ (let cmd = pkgs.writeShellScript commandName commandArg;
+ in "--${commandName} ${cmd}");
+
+ commandLine = concatStringsSep " " ([ "${package}/bin/cbatticon" ]
++ makeCommand "command-critical-level" cfg.commandCriticalLevel
++ makeCommand "command-left-click" cfg.commandLeftClick
- ++ optional
- (cfg.iconType != null)
- "--icon-type ${cfg.iconType}"
- ++ optional
- (cfg.lowLevelPercent != null)
- "--low-level ${toString cfg.lowLevelPercent}"
- ++ optional
- (cfg.criticalLevelPercent != null)
- "--critical-level ${toString cfg.criticalLevelPercent}"
- ++ optional
- (cfg.updateIntervalSeconds != null)
- "--update-interval ${toString cfg.updateIntervalSeconds}"
- ++ optional
- (cfg.hideNotification != null && cfg.hideNotification)
- "--hide-notification"
- );
-
-in
-
-{
+ ++ optional (cfg.iconType != null) "--icon-type ${cfg.iconType}"
+ ++ optional (cfg.lowLevelPercent != null)
+ "--low-level ${toString cfg.lowLevelPercent}"
+ ++ optional (cfg.criticalLevelPercent != null)
+ "--critical-level ${toString cfg.criticalLevelPercent}"
+ ++ optional (cfg.updateIntervalSeconds != null)
+ "--update-interval ${toString cfg.updateIntervalSeconds}"
+ ++ optional (cfg.hideNotification != null && cfg.hideNotification)
+ "--hide-notification");
+
+in {
meta.maintainers = [ maintainers.pmiddend ];
options = {
@@ -66,7 +53,8 @@ in
};
iconType = mkOption {
- type = types.nullOr (types.enum [ "standard" "notification" "symbolic" ]);
+ type =
+ types.nullOr (types.enum [ "standard" "notification" "symbolic" ]);
default = null;
example = "symbolic";
description = "Icon type to display in the system tray.";
@@ -119,9 +107,7 @@ in
PartOf = [ "graphical-session.target" ];
};
- Install = {
- WantedBy = [ "graphical-session.target" ];
- };
+ Install = { WantedBy = [ "graphical-session.target" ]; };
Service = {
ExecStart = commandLine;