mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-17 14:31:09 +01:00
cbatticon: add package to options
This commit is contained in:
parent
d47259b685
commit
ca2ab1d877
1 changed files with 4 additions and 4 deletions
|
|
@ -9,8 +9,6 @@ let
|
||||||
|
|
||||||
cfg = config.services.cbatticon;
|
cfg = config.services.cbatticon;
|
||||||
|
|
||||||
package = pkgs.cbatticon;
|
|
||||||
|
|
||||||
makeCommand =
|
makeCommand =
|
||||||
commandName: commandArg:
|
commandName: commandArg:
|
||||||
optional (commandArg != null) (
|
optional (commandArg != null) (
|
||||||
|
|
@ -21,7 +19,7 @@ let
|
||||||
);
|
);
|
||||||
|
|
||||||
commandLine = lib.concatStringsSep " " (
|
commandLine = lib.concatStringsSep " " (
|
||||||
[ "${package}/bin/cbatticon" ]
|
[ (lib.getExe cfg.package) ]
|
||||||
++ makeCommand "command-critical-level" cfg.commandCriticalLevel
|
++ makeCommand "command-critical-level" cfg.commandCriticalLevel
|
||||||
++ makeCommand "command-left-click" cfg.commandLeftClick
|
++ makeCommand "command-left-click" cfg.commandLeftClick
|
||||||
++ optional (cfg.iconType != null) "--icon-type ${cfg.iconType}"
|
++ optional (cfg.iconType != null) "--icon-type ${cfg.iconType}"
|
||||||
|
|
@ -44,6 +42,8 @@ in
|
||||||
services.cbatticon = {
|
services.cbatticon = {
|
||||||
enable = lib.mkEnableOption "cbatticon";
|
enable = lib.mkEnableOption "cbatticon";
|
||||||
|
|
||||||
|
package = lib.mkPackageOption pkgs "cbatticon" { };
|
||||||
|
|
||||||
commandCriticalLevel = mkOption {
|
commandCriticalLevel = mkOption {
|
||||||
type = types.nullOr types.lines;
|
type = types.nullOr types.lines;
|
||||||
default = null;
|
default = null;
|
||||||
|
|
@ -127,7 +127,7 @@ in
|
||||||
(lib.hm.assertions.assertPlatform "services.cbatticon" pkgs lib.platforms.linux)
|
(lib.hm.assertions.assertPlatform "services.cbatticon" pkgs lib.platforms.linux)
|
||||||
];
|
];
|
||||||
|
|
||||||
home.packages = [ package ];
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
systemd.user.services.cbatticon = {
|
systemd.user.services.cbatticon = {
|
||||||
Unit = {
|
Unit = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue