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
7 changed files with 61 additions and 0 deletions

View File

@@ -2094,6 +2094,15 @@ in {
Dockerfile-like syntax for fast builds and simplicity.
'';
}
{
time = "2025-02-22T16:53:20+00:00";
message = ''
A new module is available: 'programs.jqp'.
A TUI playground for experimentingn with `jq`.
'';
}
];
};
}

View File

@@ -140,6 +140,7 @@ let
./programs/java.nix
./programs/jetbrains-remote.nix
./programs/jq.nix
./programs/jqp.nix
./programs/jujutsu.nix
./programs/joshuto.nix
./programs/joplin-desktop.nix

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;
};
};
};
}

View File

@@ -171,6 +171,7 @@ in import nmtSrc {
./modules/programs/irssi
./modules/programs/jujutsu
./modules/programs/joplin-desktop
./modules/programs/jqp
./modules/programs/k9s
./modules/programs/kakoune
./modules/programs/khal

View File

@@ -0,0 +1,14 @@
{
programs = {
jqp = {
enable = true;
settings = { theme.name = "catppuccin-frappe"; };
};
};
nmt.script = ''
assertFileExists home-files/.jqp.yaml
assertFileContent home-files/.jqp.yaml \
${./basic-configuration.yaml}
'';
}

View File

@@ -0,0 +1,2 @@
theme:
name: catppuccin-frappe

View File

@@ -0,0 +1 @@
{ jqp-basic-configuration = ./basic-configuration.nix; }