1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-18 15:59:48 +01:00
home-manager/modules/programs/fuzzel.nix

52 lines
1.2 KiB
Nix
Raw Normal View History

2023-03-01 15:57:55 +01:00
{ config, lib, pkgs, ... }:
let
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 = {
enable = mkEnableOption "fuzzel";
2023-03-01 15:57:55 +01: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";
}
'';
description = ''
2023-03-01 15:57:55 +01:00
Configuration for fuzzel written to
{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;
};
};
}