diff --git a/modules/services/cbatticon.nix b/modules/services/cbatticon.nix index 2f0a8d94e..c441f1799 100644 --- a/modules/services/cbatticon.nix +++ b/modules/services/cbatticon.nix @@ -9,8 +9,6 @@ let cfg = config.services.cbatticon; - package = pkgs.cbatticon; - makeCommand = commandName: commandArg: optional (commandArg != null) ( @@ -21,7 +19,7 @@ let ); commandLine = lib.concatStringsSep " " ( - [ "${package}/bin/cbatticon" ] + [ (lib.getExe cfg.package) ] ++ makeCommand "command-critical-level" cfg.commandCriticalLevel ++ makeCommand "command-left-click" cfg.commandLeftClick ++ optional (cfg.iconType != null) "--icon-type ${cfg.iconType}" @@ -44,6 +42,8 @@ in services.cbatticon = { enable = lib.mkEnableOption "cbatticon"; + package = lib.mkPackageOption pkgs "cbatticon" { }; + commandCriticalLevel = mkOption { type = types.nullOr types.lines; default = null; @@ -127,7 +127,7 @@ in (lib.hm.assertions.assertPlatform "services.cbatticon" pkgs lib.platforms.linux) ]; - home.packages = [ package ]; + home.packages = [ cfg.package ]; systemd.user.services.cbatticon = { Unit = {