mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-12 01:59:37 +08:00
jqp: add module (#5716)
This commit is contained in:
committed by
GitHub
parent
a51e94e51c
commit
4949081d1e
@@ -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`.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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
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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -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
|
||||
|
||||
14
tests/modules/programs/jqp/basic-configuration.nix
Normal file
14
tests/modules/programs/jqp/basic-configuration.nix
Normal 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}
|
||||
'';
|
||||
}
|
||||
2
tests/modules/programs/jqp/basic-configuration.yaml
Normal file
2
tests/modules/programs/jqp/basic-configuration.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
theme:
|
||||
name: catppuccin-frappe
|
||||
1
tests/modules/programs/jqp/default.nix
Normal file
1
tests/modules/programs/jqp/default.nix
Normal file
@@ -0,0 +1 @@
|
||||
{ jqp-basic-configuration = ./basic-configuration.nix; }
|
||||
Reference in New Issue
Block a user