jqp: add module (#5716)
This commit is contained in:
parent
a51e94e51c
commit
4949081d1e
7 changed files with 61 additions and 0 deletions
33
modules/programs/jqp.nix
Normal file
33
modules/programs/jqp.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue