jqp: add module (#5716)

This commit is contained in:
Feliche-Demian Netliukh 2025-02-22 16:23:01 +00:00 committed by GitHub
parent a51e94e51c
commit 4949081d1e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 61 additions and 0 deletions

33
modules/programs/jqp.nix Normal file
View file

@ -0,0 +1,33 @@
{ 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" { };
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 = [ cfg.package ];
file.".jqp.yaml" = lib.mkIf (cfg.settings != { }) {
source = yamlFormat.generate "jqp-config" cfg.settings;
};
};
};
}