depot/third_party/home-manager/modules/programs/hyfetch.nix
Default email 2eafb8192e Project import generated by Copybara.
GitOrigin-RevId: 176e455371a8371586e8a3ff0d56ee9f3ca2324e
2023-01-10 02:35:00 -07:00

44 lines
982 B
Nix

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.hyfetch;
jsonFormat = pkgs.formats.json { };
in {
meta.maintainers = [ maintainers.lilyinstarlight ];
options.programs.hyfetch = {
enable = mkEnableOption "hyfetch";
package = mkOption {
type = types.package;
default = pkgs.hyfetch;
defaultText = literalExpression "pkgs.hyfetch";
description = "The hyfetch package to use.";
};
settings = mkOption {
type = jsonFormat.type;
default = { };
example = literalExpression ''
{
preset = "rainbow";
mode = "rgb";
color_align = {
mode = "horizontal";
};
}
'';
description = "JSON config for HyFetch";
};
};
config = mkIf cfg.enable {
home.packages = [ cfg.package ];
xdg.configFile."hyfetch.json" = mkIf (cfg.settings != { }) {
source = jsonFormat.generate "hyfetch.json" cfg.settings;
};
};
}