2023-03-01 15:57:55 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
|
2023-07-02 01:45:18 +02:00
|
|
|
inherit (lib) literalExpression mkEnableOption mkPackageOption mkOption mkIf;
|
2023-03-01 15:57:55 +01:00
|
|
|
|
|
|
|
cfg = config.programs.fuzzel;
|
|
|
|
|
|
|
|
iniFormat = pkgs.formats.ini { };
|
|
|
|
|
|
|
|
in {
|
|
|
|
meta.maintainers = [ lib.maintainers.Scrumplex ];
|
|
|
|
|
|
|
|
options.programs.fuzzel = {
|
2023-07-02 01:45:18 +02:00
|
|
|
enable = mkEnableOption "fuzzel";
|
2023-03-01 15:57:55 +01:00
|
|
|
|
2023-07-02 01:45:18 +02:00
|
|
|
package = mkPackageOption pkgs "fuzzel" { };
|
2023-03-01 15:57:55 +01:00
|
|
|
|
|
|
|
settings = mkOption {
|
|
|
|
type = iniFormat.type;
|
|
|
|
default = { };
|
|
|
|
example = literalExpression ''
|
|
|
|
{
|
|
|
|
main = {
|
|
|
|
terminal = "''${pkgs.foot}/bin/foot";
|
|
|
|
layer = "overlay";
|
|
|
|
};
|
|
|
|
colors.background = "ffffffff";
|
|
|
|
}
|
|
|
|
'';
|
2023-07-02 01:45:18 +02:00
|
|
|
description = ''
|
2023-03-01 15:57:55 +01:00
|
|
|
Configuration for fuzzel written to
|
2023-07-01 01:30:13 +02:00
|
|
|
{file}`$XDG_CONFIG_HOME/fuzzel/fuzzel.ini`. See
|
|
|
|
{manpage}`fuzzel.ini(5)` for a list of available options.
|
2023-03-01 15:57:55 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
assertions = [
|
|
|
|
(lib.hm.assertions.assertPlatform "programs.fuzzel" pkgs
|
|
|
|
lib.platforms.linux)
|
|
|
|
];
|
|
|
|
|
|
|
|
home.packages = [ cfg.package ];
|
|
|
|
|
|
|
|
xdg.configFile."fuzzel/fuzzel.ini" = mkIf (cfg.settings != { }) {
|
|
|
|
source = iniFormat.generate "fuzzel.ini" cfg.settings;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|