mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-18 22:33:00 +00:00
34 lines
746 B
Nix
34 lines
746 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" { };
|
||
|
|
||
|
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;
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
}
|