Skip to content

Commit

Permalink
Update kicker and kickerdash settings option value type (#322)
Browse files Browse the repository at this point in the history
Also remove unnecessary `types.nullOr` from other widgets
  • Loading branch information
HeitorAugustoLN authored Aug 13, 2024
1 parent f8b0d72 commit 76dab4b
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion modules/widgets/application-title-bar.nix
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ in
};
};
settings = mkOption {
type = types.nullOr configValueType;
type = configValueType;
default = null;
example = {
Appearance = {
Expand Down
2 changes: 1 addition & 1 deletion modules/widgets/battery.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ in {
description = "Enable to show the battery percentage as a small label over the battery icon.";
};
settings = lib.mkOption {
type = lib.types.nullOr configValueType;
type = configValueType;
default = null;
example = {
General = {
Expand Down
2 changes: 1 addition & 1 deletion modules/widgets/digital-clock.nix
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ in
};
};
settings = mkOption {
type = types.nullOr configValueType;
type = configValueType;
default = null;
example = {
Appearance = {
Expand Down
2 changes: 1 addition & 1 deletion modules/widgets/icon-tasks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ in
};
};
settings = mkOption {
type = types.nullOr configValueType;
type = configValueType;
default = null;
example = {
General = {
Expand Down
2 changes: 1 addition & 1 deletion modules/widgets/keyboard-layout.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ in
apply = getIndexFromEnum enumVals;
};
settings = lib.mkOption {
type = lib.types.nullOr configValueType;
type = configValueType;
default = null;
example = {
General = {
Expand Down
3 changes: 2 additions & 1 deletion modules/widgets/kicker.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ lib, ... }:
let
inherit (lib) mkOption types;
inherit (import ./lib.nix { inherit lib; }) configValueType;

mkBoolOption = description: mkOption {
type = with types; nullOr bool;
Expand Down Expand Up @@ -82,7 +83,7 @@ in
expandSearchResults = mkBoolOption "Whether to expand the search results to bookmarks, files and emails.";
};
settings = mkOption {
type = with types; nullOr (attrsOf (attrsOf (either (oneOf [ bool float int str ]) (listOf (oneOf [ bool float int str ])))));
type = configValueType;
default = null;
example = {
General = {
Expand Down
3 changes: 2 additions & 1 deletion modules/widgets/kickerdash.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ lib, ... }:
let
inherit (lib) mkOption types;
inherit (import ./lib.nix { inherit lib; }) configValueType;

mkBoolOption = description: mkOption {
type = with types; nullOr bool;
Expand Down Expand Up @@ -75,7 +76,7 @@ in
expandSearchResults = mkBoolOption "Whether to expand the search results to bookmarks, files and emails.";
};
settings = mkOption {
type = with types; nullOr (attrsOf (attrsOf (either (oneOf [ bool float int str ]) (listOf (oneOf [ bool float int str ])))));
type = configValueType;
default = null;
example = {
General = {
Expand Down
2 changes: 1 addition & 1 deletion modules/widgets/kickoff.nix
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ in
example = 700;
};
settings = mkOption {
type = types.nullOr configValueType;
type = configValueType;
default = null;
example = {
General = {
Expand Down
2 changes: 1 addition & 1 deletion modules/widgets/plasma-panel-colorizer.nix
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ in
};
};
settings = mkOption {
type = types.nullOr configValueType;
type = configValueType;
default = null;
example = {
General = {
Expand Down
2 changes: 1 addition & 1 deletion modules/widgets/plasmusic-toolbar.nix
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ in
apply = font: if font == null then null else qfont.fontToString font;
};
settings = mkOption {
type = types.nullOr configValueType;
type = configValueType;
default = null;
example = {
General = {
Expand Down
2 changes: 1 addition & 1 deletion modules/widgets/system-monitor.nix
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ in
};
};
settings = mkOption {
type = types.nullOr configValueType;
type = configValueType;
default = null;
description = "Extra configuration options for the widget.";
apply = settings: if settings == null then {} else settings;
Expand Down
2 changes: 1 addition & 1 deletion modules/widgets/system-tray.nix
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ in
};
};
settings = mkOption {
type = types.nullOr configValueType;
type = configValueType;
default = null;
description = "Extra configuration options for the widget.";
apply = settings: if settings == null then {} else settings;
Expand Down

0 comments on commit 76dab4b

Please sign in to comment.