mirror of
https://github.com/nix-community/home-manager
synced 2024-06-01 04:23:34 +02:00
Merge 33f9f63236
into 6d3b6dc922
This commit is contained in:
commit
dc066f8c18
|
@ -548,4 +548,10 @@
|
||||||
github = "zorrobert";
|
github = "zorrobert";
|
||||||
githubId = 118135271;
|
githubId = 118135271;
|
||||||
};
|
};
|
||||||
|
afresquet = {
|
||||||
|
name = "Alvaro Fresquet";
|
||||||
|
email = "29437693+afresquet@users.noreply.github.com";
|
||||||
|
github = "afresquet";
|
||||||
|
githubId = 29437693;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1584,6 +1584,17 @@ in {
|
||||||
https://conky.cc/ for more.
|
https://conky.cc/ for more.
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2024-05-02T00:25:03+00:00";
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'programs.fastfetch'.
|
||||||
|
|
||||||
|
Fastfetch is a neofetch-like tool for fetching system information
|
||||||
|
and displaying them in a pretty way. See
|
||||||
|
https://github.com/fastfetch-cli/fastfetch for more.
|
||||||
|
'';
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,6 +87,7 @@ let
|
||||||
./programs/emacs.nix
|
./programs/emacs.nix
|
||||||
./programs/eww.nix
|
./programs/eww.nix
|
||||||
./programs/eza.nix
|
./programs/eza.nix
|
||||||
|
./programs/fastfetch.nix
|
||||||
./programs/fd.nix
|
./programs/fd.nix
|
||||||
./programs/feh.nix
|
./programs/feh.nix
|
||||||
./programs/firefox.nix
|
./programs/firefox.nix
|
||||||
|
|
96
modules/programs/fastfetch.nix
Normal file
96
modules/programs/fastfetch.nix
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
{ pkgs, lib, config, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
cfg = config.programs.fastfetch;
|
||||||
|
|
||||||
|
jsonFormat = pkgs.formats.json { };
|
||||||
|
|
||||||
|
in {
|
||||||
|
meta.maintainers = [ lib.hm.maintainers.afresquet ];
|
||||||
|
|
||||||
|
options.programs.fastfetch = {
|
||||||
|
enable = lib.mkEnableOption "Fastfetch";
|
||||||
|
|
||||||
|
package = lib.mkPackageOption pkgs "fastfetch" { };
|
||||||
|
|
||||||
|
settings = lib.mkOption {
|
||||||
|
type = jsonFormat.type;
|
||||||
|
default = {
|
||||||
|
modules = [
|
||||||
|
"title"
|
||||||
|
"separator"
|
||||||
|
"os"
|
||||||
|
"host"
|
||||||
|
"kernel"
|
||||||
|
"uptime"
|
||||||
|
"packages"
|
||||||
|
"shell"
|
||||||
|
"display"
|
||||||
|
"de"
|
||||||
|
"wm"
|
||||||
|
"wmtheme"
|
||||||
|
"theme"
|
||||||
|
"icons"
|
||||||
|
"font"
|
||||||
|
"cursor"
|
||||||
|
"terminal"
|
||||||
|
"terminalfont"
|
||||||
|
"cpu"
|
||||||
|
"gpu"
|
||||||
|
"memory"
|
||||||
|
"swap"
|
||||||
|
"disk"
|
||||||
|
"localip"
|
||||||
|
"battery"
|
||||||
|
"poweradapter"
|
||||||
|
"locale"
|
||||||
|
"break"
|
||||||
|
"colors"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
example = lib.literalExpression ''
|
||||||
|
{
|
||||||
|
logo = {
|
||||||
|
source = "nixos_small";
|
||||||
|
padding = {
|
||||||
|
right = 1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
display = {
|
||||||
|
binaryPrefix = "si";
|
||||||
|
color = "blue";
|
||||||
|
separator = " ";
|
||||||
|
};
|
||||||
|
modules = [
|
||||||
|
{
|
||||||
|
type = "datetime";
|
||||||
|
key = "Date";
|
||||||
|
format = "{1}-{3}-{11}";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type = "datetime";
|
||||||
|
key = "Time";
|
||||||
|
format = "{14}:{17}:{20}";
|
||||||
|
}
|
||||||
|
"break"
|
||||||
|
"player"
|
||||||
|
"media"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Configuration written to {file}`$XDG_CONFIG_HOME/fastfetch/config.jsonc`.
|
||||||
|
See <https://github.com/fastfetch-cli/fastfetch/wiki/Json-Schema>
|
||||||
|
for the documentation.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
|
xdg.configFile."fastfetch/config.jsonc".source =
|
||||||
|
jsonFormat.generate "config.jsonc" cfg.settings;
|
||||||
|
};
|
||||||
|
}
|
|
@ -71,6 +71,7 @@ in import nmtSrc {
|
||||||
./modules/programs/dircolors
|
./modules/programs/dircolors
|
||||||
./modules/programs/direnv
|
./modules/programs/direnv
|
||||||
./modules/programs/emacs
|
./modules/programs/emacs
|
||||||
|
./modules/programs/fastfetch
|
||||||
./modules/programs/feh
|
./modules/programs/feh
|
||||||
./modules/programs/fish
|
./modules/programs/fish
|
||||||
./modules/programs/gallery-dl
|
./modules/programs/gallery-dl
|
||||||
|
|
28
tests/modules/programs/fastfetch/basic-configuration.jsonc
Executable file
28
tests/modules/programs/fastfetch/basic-configuration.jsonc
Executable file
|
@ -0,0 +1,28 @@
|
||||||
|
{
|
||||||
|
"display": {
|
||||||
|
"binaryPrefix": "si",
|
||||||
|
"color": "blue",
|
||||||
|
"separator": " "
|
||||||
|
},
|
||||||
|
"logo": {
|
||||||
|
"padding": {
|
||||||
|
"right": 1
|
||||||
|
},
|
||||||
|
"source": "nixos_small"
|
||||||
|
},
|
||||||
|
"modules": [
|
||||||
|
{
|
||||||
|
"format": "{1}-{3}-{11}",
|
||||||
|
"key": "Date",
|
||||||
|
"type": "datetime"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"format": "{14}:{17}:{20}",
|
||||||
|
"key": "Time",
|
||||||
|
"type": "datetime"
|
||||||
|
},
|
||||||
|
"break",
|
||||||
|
"player",
|
||||||
|
"media"
|
||||||
|
]
|
||||||
|
}
|
39
tests/modules/programs/fastfetch/basic-configuration.nix
Normal file
39
tests/modules/programs/fastfetch/basic-configuration.nix
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
{
|
||||||
|
programs.fastfetch = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
logo = {
|
||||||
|
source = "nixos_small";
|
||||||
|
padding = { right = 1; };
|
||||||
|
};
|
||||||
|
display = {
|
||||||
|
binaryPrefix = "si";
|
||||||
|
color = "blue";
|
||||||
|
separator = " ";
|
||||||
|
};
|
||||||
|
modules = [
|
||||||
|
{
|
||||||
|
type = "datetime";
|
||||||
|
key = "Date";
|
||||||
|
format = "{1}-{3}-{11}";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type = "datetime";
|
||||||
|
key = "Time";
|
||||||
|
format = "{14}:{17}:{20}";
|
||||||
|
}
|
||||||
|
"break"
|
||||||
|
"player"
|
||||||
|
"media"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
test.stubs.fastfetch = { };
|
||||||
|
|
||||||
|
nmt.script = let config-file = "home-files/.config/fastfetch/config.jsonc";
|
||||||
|
in ''
|
||||||
|
assertFileExists "${config-file}"
|
||||||
|
assertFileContent "${config-file}" ${./basic-configuration.jsonc}
|
||||||
|
'';
|
||||||
|
}
|
33
tests/modules/programs/fastfetch/default-configuration.jsonc
Executable file
33
tests/modules/programs/fastfetch/default-configuration.jsonc
Executable file
|
@ -0,0 +1,33 @@
|
||||||
|
{
|
||||||
|
"modules": [
|
||||||
|
"title",
|
||||||
|
"separator",
|
||||||
|
"os",
|
||||||
|
"host",
|
||||||
|
"kernel",
|
||||||
|
"uptime",
|
||||||
|
"packages",
|
||||||
|
"shell",
|
||||||
|
"display",
|
||||||
|
"de",
|
||||||
|
"wm",
|
||||||
|
"wmtheme",
|
||||||
|
"theme",
|
||||||
|
"icons",
|
||||||
|
"font",
|
||||||
|
"cursor",
|
||||||
|
"terminal",
|
||||||
|
"terminalfont",
|
||||||
|
"cpu",
|
||||||
|
"gpu",
|
||||||
|
"memory",
|
||||||
|
"swap",
|
||||||
|
"disk",
|
||||||
|
"localip",
|
||||||
|
"battery",
|
||||||
|
"poweradapter",
|
||||||
|
"locale",
|
||||||
|
"break",
|
||||||
|
"colors"
|
||||||
|
]
|
||||||
|
}
|
11
tests/modules/programs/fastfetch/default-configuration.nix
Normal file
11
tests/modules/programs/fastfetch/default-configuration.nix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
programs.fastfetch.enable = true;
|
||||||
|
|
||||||
|
test.stubs.fastfetch = { };
|
||||||
|
|
||||||
|
nmt.script = let config-file = "home-files/.config/fastfetch/config.jsonc";
|
||||||
|
in ''
|
||||||
|
assertFileExists "${config-file}"
|
||||||
|
assertFileContent "${config-file}" ${./default-configuration.jsonc}
|
||||||
|
'';
|
||||||
|
}
|
4
tests/modules/programs/fastfetch/default.nix
Normal file
4
tests/modules/programs/fastfetch/default.nix
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
fastfetch-default-configuration = ./default-configuration.nix;
|
||||||
|
fastfetch-basic-configuration = ./basic-configuration.nix;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user