hyfetch: add module

This commit is contained in:
Lily Foster 2022-08-01 11:03:41 -04:00 committed by Robert Helgesson
parent 7146638e9e
commit d1c677ac25
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
8 changed files with 92 additions and 0 deletions

View file

@ -0,0 +1,43 @@
{ 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".source =
jsonFormat.generate "hyfetch.json" cfg.settings;
};
}