diff --git a/nix/sharedConfig.nix b/nix/sharedConfig.nix index b297e81..7cc25a7 100644 --- a/nix/sharedConfig.nix +++ b/nix/sharedConfig.nix @@ -1,8 +1,7 @@ -{lib, ...}: +{ lib, ... }: with lib; { enable = mkEnableOption "cli to take screenshots"; copy = mkEnableOption "Copy screenshot to clipboard"; - window-controls = mkEnableOption "Enable window controls"; shadow = mkEnableOption "Enable shadows"; shadow-image = mkEnableOption "Enable shadows from captured image"; fonts = mkOption { @@ -11,11 +10,6 @@ with lib; { example = "Hack=12.0;Noto Font Emoji=12.0;"; description = "The font used to render, format: Font Name=size;Other Font Name=12.0"; }; - background = mkOption { - type = types.str; - default = "#323232"; - description = "Background of image generated. Support: '#RRGGBBAA' 'h;#RRGGBBAA;#RRGGBBAA' 'v;#RRGGBBAA;#RRGGBBAA' or file path"; - }; radius = mkOption { type = types.int; default = 15; @@ -26,43 +20,11 @@ with lib; { default = null; description = "Author Name of screenshot"; }; - author-color = mkOption { - type = types.str; - default = "#FFFFFF"; - description = "Title bar text color"; - }; window-title = mkOption { type = lib.types.nullOr types.str; default = null; description = "Window title"; }; - window-title-background = mkOption { - type = types.str; - default = "#4287f5"; - description = "Window title bar background"; - }; - - window-title-color = mkOption { - type = types.str; - default = "#FFFFFF"; - description = "Title bar text color"; - }; - window-controls-width = mkOption { - type = types.int; - default = 120; - description = "Width of window controls"; - }; - window-controls-height = mkOption { - type = types.int; - default = 40; - description = "Height of window title/controls bar"; - }; - titlebar-padding = mkOption { - type = types.int; - default = 10; - description = "Padding of title on window bar"; - }; - padding-x = mkOption { type = types.int; default = 80; @@ -73,19 +35,65 @@ with lib; { default = 100; description = "Padding Y of inner screenshot"; }; - shadow-color = mkOption { - type = types.str; - default = "#707070"; - description = "Shadow of screenshot. Support: '#RRGGBBAA' 'h;#RRGGBBAA;#RRGGBBAA' 'v;#RRGGBBAA;#RRGGBBAA' or file path"; - }; shadow-blur = mkOption { type = types.int; default = 50; description = "Blur of shadow"; }; save-format = mkOption { - type = types.enum ["png" "jpeg" "webp"]; + type = types.enum [ "png" "jpeg" "webp" ]; default = "png"; description = "The format in which the image will be saved"; }; + + colors = mkOption { + type = types.attrsOf (types.submodule { + background = mkOption { + type = types.str; + default = "#323232"; + description = "Background of image generated. Support: '#RRGGBBAA' 'h;#RRGGBBAA;#RRGGBBAA' 'v;#RRGGBBAA;#RRGGBBAA' or file path"; + }; + author = mkOption { + type = types.str; + default = "#FFFFFF"; + description = "Title bar text color"; + }; + window-background = mkOption { + type = types.str; + default = "#4287f5"; + description = "Window title bar background"; + }; + shadow = mkOption { + type = types.str; + default = "#707070"; + description = "Shadow of screenshot. Support: '#RRGGBBAA' 'h;#RRGGBBAA;#RRGGBBAA' 'v;#RRGGBBAA;#RRGGBBAA' or file path"; + }; + title = mkOption { + type = types.str; + default = "#FFFFFF"; + description = "Title bar text color"; + }; + }); + }; + + window-controls = mkOption { + type = types.attrsOf (types.submodule { + enable = mkEnableOption "cli to take screenshots"; + width = mkOption { + type = types.int; + default = 120; + description = "Width of window controls"; + }; + height = mkOption { + type = types.int; + default = 40; + description = "Height of window title/controls bar"; + }; + titlebar-padding = mkOption { + type = types.int; + default = 10; + description = "Padding of title on window bar"; + }; + }); + }; }