hyprland rice in full swing

This commit is contained in:
atagen 2023-03-23 19:59:35 +11:00
parent c3a0f09a41
commit bc72aada53
19 changed files with 2278 additions and 145 deletions

62
home/homepkgs/fuzzel.nix Normal file
View file

@ -0,0 +1,62 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.fuzzel;
iniFormat = pkgs.formats.ini { };
in {
options = {
programs.fuzzel = {
enable = mkEnableOption "Fuzzel";
package = mkOption {
type = types.package;
default = pkgs.fuzzel;
defaultText = literalExpression "pkgs.fuzzel";
description = "The Fuzzel package to install.";
};
settings = mkOption {
type = iniFormat.type;
default = { };
example = literalExpression ''
{
window.dimensions = {
lines = 3;
columns = 200;
};
key_bindings = [
{
key = "K";
mods = "Control";
chars = "\\x0c";
}
];
}
'';
description = ''
Configuration written to
<filename>$XDG_CONFIG_HOME/fuzzel/fuzzel.ini</filename>.
'';
};
};
};
config = mkMerge [
(mkIf cfg.enable {
home.packages = [ cfg.package ];
xdg.configFile."fuzzel/fuzzel.ini" = mkIf (cfg.settings != { }) {
# TODO: Replace by the generate function but need to figure out how to
# handle the escaping first.
#
# source = yamlFormat.generate "alacritty.yml" cfg.settings;
text =
replaceStrings [ "\\\\" ] [ "\\" ] (builtins.toJSON cfg.settings);
};
})
];
}