2022-08-01 17:03:41 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.programs.hyfetch;
|
|
|
|
|
|
|
|
jsonFormat = pkgs.formats.json { };
|
|
|
|
in {
|
2024-07-05 01:18:45 +02:00
|
|
|
meta.maintainers = [ hm.maintainers.lilyinstarlight ];
|
2022-08-01 17:03:41 +02:00
|
|
|
|
|
|
|
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 ];
|
2022-08-02 01:58:38 +02:00
|
|
|
xdg.configFile."hyfetch.json" = mkIf (cfg.settings != { }) {
|
|
|
|
source = jsonFormat.generate "hyfetch.json" cfg.settings;
|
|
|
|
};
|
2022-08-01 17:03:41 +02:00
|
|
|
};
|
|
|
|
}
|