mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-18 14:28:15 +00:00
Can generate the config without installing application through home-manager. Helpful when a package is broken (or not provided) on a specific platform through nixpkgs and needs to be installed through other means but you still can benefit from the declarative configuration.
33 lines
794 B
Nix
33 lines
794 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" { nullable = true; };
|
|
|
|
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 = lib.mkIf (cfg.package != null) [ cfg.package ];
|
|
|
|
file.".jqp.yaml" = lib.mkIf (cfg.settings != { }) {
|
|
source = yamlFormat.generate "jqp-config" cfg.settings;
|
|
};
|
|
};
|
|
};
|
|
}
|