2023-04-20 08:11:30 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.programs.wofi;
|
|
|
|
|
|
|
|
toConfig = attrs:
|
|
|
|
''
|
|
|
|
# Generated by Home Manager.
|
|
|
|
'' + generators.toKeyValue { }
|
|
|
|
(filterAttrs (name: value: value != null) attrs);
|
|
|
|
in {
|
|
|
|
meta.maintainers = [ maintainers.christoph-heiss ];
|
|
|
|
|
|
|
|
options.programs.wofi = {
|
2023-07-02 01:45:18 +02:00
|
|
|
enable = mkEnableOption
|
|
|
|
"wofi: a launcher/menu program for wlroots based wayland compositors such as sway";
|
2023-04-20 08:11:30 +02:00
|
|
|
|
2023-07-02 01:45:18 +02:00
|
|
|
package = mkPackageOption pkgs "wofi" { };
|
2023-04-20 08:11:30 +02:00
|
|
|
|
|
|
|
settings = mkOption {
|
|
|
|
default = { };
|
|
|
|
type = types.attrs;
|
2023-07-02 01:45:18 +02:00
|
|
|
description = ''
|
2023-04-20 08:11:30 +02:00
|
|
|
Configuration options for wofi. See
|
2023-07-01 01:30:13 +02:00
|
|
|
{manpage}`wofi(5)`.
|
2023-04-20 08:11:30 +02:00
|
|
|
'';
|
|
|
|
example = literalExpression ''
|
|
|
|
{
|
|
|
|
location = "bottom-right";
|
|
|
|
allow_markup = true;
|
|
|
|
width = 250;
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
style = mkOption {
|
|
|
|
default = null;
|
|
|
|
type = types.nullOr types.str;
|
2023-07-02 01:45:18 +02:00
|
|
|
description = ''
|
2023-04-20 08:11:30 +02:00
|
|
|
CSS style for wofi to use as a stylesheet. See
|
2023-07-01 01:30:13 +02:00
|
|
|
{manpage}`wofi(7)`.
|
2023-04-20 08:11:30 +02:00
|
|
|
'';
|
|
|
|
example = ''
|
|
|
|
* {
|
|
|
|
font-family: monospace;
|
|
|
|
}
|
|
|
|
|
|
|
|
window {
|
|
|
|
background-color: #7c818c;
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
assertions =
|
|
|
|
[ (hm.assertions.assertPlatform "programs.wofi" pkgs platforms.linux) ];
|
|
|
|
|
|
|
|
home.packages = [ cfg.package ];
|
|
|
|
|
|
|
|
xdg.configFile = mkMerge [
|
|
|
|
(mkIf (cfg.settings != { }) {
|
|
|
|
"wofi/config".text = toConfig cfg.settings;
|
|
|
|
})
|
|
|
|
(mkIf (cfg.style != null) { "wofi/style.css".text = cfg.style; })
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|