1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00
home-manager/modules/programs/sway-easyfocus.nix
Austin Horstman 86402a17b6 treewide: flatten single file modules
Some files don't need nesting and can be root level again to reduce
conflicts with other PRs.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-06-23 16:20:26 -05:00

51 lines
1.3 KiB
Nix

{
lib,
pkgs,
config,
...
}:
let
inherit (lib)
mkIf
mkEnableOption
mkPackageOption
mkOption
;
cfg = config.programs.sway-easyfocus;
formatter = pkgs.formats.yaml { };
in
{
meta.maintainers = with lib.hm.maintainers; [ aguirre-matteo ];
options.programs.sway-easyfocus = {
enable = mkEnableOption "sway-easyfocus";
package = mkPackageOption pkgs "sway-easyfocus" { nullable = true; };
settings = mkOption {
type = formatter.type;
default = { };
example = {
chars = "fjghdkslaemuvitywoqpcbnxz";
window_background_color = "d1f21";
window_background_opacity = 0.2;
focused_background_color = "285577";
focused_background_opacity = 1.0;
focused_text_color = "ffffff";
font_family = "monospace";
font_weight = "bold";
font_size = "medium";
};
description = ''
Configuration settings for sway-easyfocus. All available options can be found here:
<https://github.com/edzdez/sway-easyfocus?tab=readme-ov-file#config-file>.
'';
};
};
config = mkIf cfg.enable {
home.packages = mkIf (cfg.package != null) [ cfg.package ];
xdg.configFile."sway-easyfocus/config.yaml" = mkIf (cfg.settings != { }) {
source = formatter.generate "sway-easyfocus-config.yaml" cfg.settings;
};
};
}