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,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;
};
}
);
};
}