mirror of
https://github.com/nix-community/home-manager
synced 2024-11-30 06:59:45 +01:00
hyfetch: add module
This commit is contained in:
parent
7146638e9e
commit
d1c677ac25
8 changed files with 92 additions and 0 deletions
3
.github/CODEOWNERS
vendored
3
.github/CODEOWNERS
vendored
|
@ -123,6 +123,9 @@ Makefile @thiagokokada
|
|||
/modules/programs/htop.nix @bjpbakker
|
||||
/tests/modules/htop @bjpbakker
|
||||
|
||||
/modules/programs/hyfetch.nix @lilyinstarlight
|
||||
/tests/modules/programs/hyfetch @lilyinstarlight
|
||||
|
||||
/modules/programs/i3status.nix @JustinLovinger
|
||||
|
||||
/modules/programs/i3status-rust.nix @workflow
|
||||
|
|
|
@ -632,6 +632,13 @@ in
|
|||
A new module is available: 'services.recoll'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2022-08-01T16:35:28+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.hyfetch'.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -82,6 +82,7 @@ let
|
|||
./programs/himalaya.nix
|
||||
./programs/home-manager.nix
|
||||
./programs/htop.nix
|
||||
./programs/hyfetch.nix
|
||||
./programs/i3status-rust.nix
|
||||
./programs/i3status.nix
|
||||
./programs/info.nix
|
||||
|
|
43
modules/programs/hyfetch.nix
Normal file
43
modules/programs/hyfetch.nix
Normal 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;
|
||||
};
|
||||
}
|
|
@ -74,6 +74,7 @@ import nmt {
|
|||
./modules/programs/helix
|
||||
./modules/programs/himalaya
|
||||
./modules/programs/htop
|
||||
./modules/programs/hyfetch
|
||||
./modules/programs/i3status
|
||||
./modules/programs/irssi
|
||||
./modules/programs/kakoune
|
||||
|
|
1
tests/modules/programs/hyfetch/default.nix
Normal file
1
tests/modules/programs/hyfetch/default.nix
Normal file
|
@ -0,0 +1 @@
|
|||
{ hyfetch-settings = ./settings.nix; }
|
11
tests/modules/programs/hyfetch/hyfetch.json
Normal file
11
tests/modules/programs/hyfetch/hyfetch.json
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"color_align": {
|
||||
"custom_colors": [],
|
||||
"fore_back": null,
|
||||
"mode": "horizontal"
|
||||
},
|
||||
"light_dark": "dark",
|
||||
"lightness": 0.5,
|
||||
"mode": "rgb",
|
||||
"preset": "rainbow"
|
||||
}
|
25
tests/modules/programs/hyfetch/settings.nix
Normal file
25
tests/modules/programs/hyfetch/settings.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
programs.hyfetch = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
preset = "rainbow";
|
||||
mode = "rgb";
|
||||
light_dark = "dark";
|
||||
lightness = 0.5;
|
||||
color_align = {
|
||||
mode = "horizontal";
|
||||
custom_colors = [ ];
|
||||
fore_back = null;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
test.stubs.hyfetch = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertFileContent home-files/.config/hyfetch.json ${./hyfetch.json}
|
||||
'';
|
||||
}
|
Loading…
Reference in a new issue