1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-23 19:49:45 +01:00
home-manager/modules/programs/hyfetch.nix
Robert Helgesson b3e9c18b63
treewide: fix eval after Nixpkgs maintainer changes
(cherry picked from commit c514e862cd)
2024-09-07 11:46:56 +02:00

44 lines
985 B
Nix

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.hyfetch;
jsonFormat = pkgs.formats.json { };
in {
meta.maintainers = [ hm.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;
};
};
}