refactor: massively overhaul home manager module system

This commit is contained in:
Youwen Wu 2024-12-25 19:47:59 -08:00
parent b2270408fc
commit a506d2aed4
Signed by: youwen
GPG key ID: 865658ED1FE61EC3
64 changed files with 5201 additions and 64 deletions

View file

@ -0,0 +1,81 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"display": {
"separator": " "
},
"modules": [
"break",
"break",
"break",
"break",
"break",
{
"type": "title",
"keyWidth": 10
},
"break",
{
"type": "os",
"key": " ",
"keyColor": "34",
"format": "{3} on {12}"
},
{
"type": "kernel",
"key": " ",
"keyColor": "34"
},
{
"type": "packages",
"key": " ",
"keyColor": "34"
},
{
"type": "shell",
"key": " ",
"keyColor": "34"
},
{
"type": "terminal",
"key": " ",
"keyColor": "34"
},
{
"type": "wm",
"key": " ",
"keyColor": "34"
},
{
"type": "CPU",
"key": " ",
"keyColor": "34"
},
{
"type": "GPU",
"key": "󰍹 ",
"keyColor": "34"
},
{
"type": "uptime",
"key": " ",
"keyColor": "34"
},
{
"type": "media",
"key": "󰝚 ",
"keyColor": "34"
},
{
"type": "player",
"key": " ",
"keyColor": "34"
},
"break",
{
"type": "custom",
"format": "\u001b[90m \u001b[31m \u001b[32m \u001b[33m \u001b[34m \u001b[35m \u001b[36m \u001b[37m "
},
"break",
"break"
]
}

View file

@ -0,0 +1,39 @@
{ config, lib, ... }:
let
fastfetchConfig = builtins.fromJSON (builtins.readFile ./config.json);
cfg = config.liminalOS.shellEnv.fastfetch;
in
{
options.liminalOS.shellEnv.fastfetch = {
enable = lib.mkOption {
type = lib.types.bool;
default = config.liminalOS.shellEnv.enable;
description = ''
Whether to set up and configure fastfetch.
'';
};
useKittyImage = lib.mkOption {
type = lib.types.bool;
default = cfg.enable;
description = ''
Whether to use the kitty image protocol.
'';
};
};
config.programs.fastfetch = lib.mkIf cfg.enable {
enable = true;
settings = (
fastfetchConfig
// {
logo = {
height = 18;
padding = {
top = 2;
};
type = if cfg.useKittyImage then "kitty" else "auto";
source = lib.mkIf cfg.useKittyImage ./nixos-logo.png;
};
}
);
};
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB