2024-09-09 00:22:14 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
2024-09-13 01:50:53 +00:00
|
|
|
with lib; let
|
2024-09-09 00:22:14 +00:00
|
|
|
fastfetch = "${pkgs.fastfetch}/bin/fastfetch";
|
|
|
|
|
|
|
|
cfg = config.custom.programs.fastfetch;
|
2024-09-13 01:50:53 +00:00
|
|
|
in {
|
2024-09-09 00:22:14 +00:00
|
|
|
options.custom.programs.fastfetch = {
|
2024-09-13 01:50:53 +00:00
|
|
|
enable = mkOption {default = false;};
|
|
|
|
greet = mkOption {default = false;};
|
2024-09-09 00:22:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
# https://github.com/fastfetch-cli/fastfetch
|
2024-09-13 01:50:53 +00:00
|
|
|
environment.systemPackages = [pkgs.fastfetch];
|
2024-09-09 00:22:14 +00:00
|
|
|
|
|
|
|
# System info greeting
|
|
|
|
programs.fish.interactiveShellInit = mkIf cfg.greet ''
|
|
|
|
# If not root, print greeting
|
|
|
|
if test (id -u) -ne 0
|
|
|
|
function fish_greeting
|
|
|
|
${fastfetch}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
'';
|
|
|
|
|
|
|
|
# https://github.com/fastfetch-cli/fastfetch
|
|
|
|
#!! Option not available, files written directly
|
|
|
|
home-manager.users.${config.custom.username}.home.file.".config/fastfetch/config.jsonc".text = ''
|
|
|
|
{
|
|
|
|
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
|
|
|
"logo": {
|
|
|
|
"source": "none",
|
|
|
|
},
|
|
|
|
"modules": [
|
|
|
|
"publicip",
|
|
|
|
"datetime",
|
|
|
|
"uptime",
|
|
|
|
"processes",
|
|
|
|
"cpuusage",
|
|
|
|
"memory",
|
|
|
|
"swap",
|
|
|
|
"disk",
|
|
|
|
"diskio",
|
|
|
|
"netio",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|