2.home-manager/modules/programs/jqp/default.nix
Austin Horstman 4fca600cb1 treewide: implement auto importing for modules
Reduce maintenance burden and increase efficiency by automatically
importing modules following a specific convention.

Co-authored-by: awwpotato <awwpotato@voidq.com>
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-06-22 23:58:37 -05:00

41 lines
824 B
Nix

{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.jqp;
yamlFormat = pkgs.formats.yaml { };
in
{
options.programs.jqp = {
enable = lib.mkEnableOption "jqp, jq playground";
package = lib.mkPackageOption pkgs "jqp" { nullable = true; };
settings = lib.mkOption {
type = yamlFormat.type;
default = { };
example = {
theme = {
name = "monokai";
chromaStyleOverrides = {
kc = "#009900 underline";
};
};
};
description = "Jqp configuration";
};
};
config = lib.mkIf cfg.enable {
home = {
packages = lib.mkIf (cfg.package != null) [ cfg.package ];
file.".jqp.yaml" = lib.mkIf (cfg.settings != { }) {
source = yamlFormat.generate "jqp-config" cfg.settings;
};
};
};
}