refactor: major theme refactor

new profile catagory: theme. refactor modules for wallpaper, fonts, gtk,
and qt. adjusted modules that depend on old theming modules
This commit is contained in:
ooks-io 2024-04-06 22:38:54 +13:00
parent 7d910ba77c
commit f5e87f2a79
34 changed files with 217 additions and 118 deletions

View file

@ -2,19 +2,15 @@
{
imports = [
./fonts
./monitors
./wallpaper
./nix
./userDirs
./home
./nixColors
./mimeApps
];
options.homeModules.config = {
nix.enable = lib.mkEnableOption "enable nix configuration module";
nixColors.enable = lib.mkEnableOption "enable nixColors configuration module";
home.enable = lib.mkEnableOption "enable home configuration module";
userDirs.enable = lib.mkEnableOption "enable userDirs configuration module";
mimeApps.enable = lib.mkEnableOption "enable mimeApps configuration module";

View file

@ -1,32 +0,0 @@
{ lib, config, ... }:
let
mkFontOption = kind: {
family = lib.mkOption {
type = lib.types.str;
default = null;
description = "Family name for ${kind} font profile";
example = "Fira Code";
};
package = lib.mkOption {
type = lib.types.package;
default = null;
description = "Package for ${kind} font profile";
example = "pkgs.fira-code";
};
};
cfg = config.fontProfiles;
in
{
options.fontProfiles = {
enable = lib.mkEnableOption "Whether to enable font profiles";
monospace = mkFontOption "monospace";
regular = mkFontOption "regular";
};
config = lib.mkIf cfg.enable {
fonts.fontconfig.enable = true;
home.packages = [ cfg.monospace.package cfg.regular.package ];
};
}

View file

@ -1,30 +0,0 @@
{ lib, config, inputs, pkgs, ... }:
let
cfg = config.homeModules.config.nixColors;
inherit (inputs.nix-colors) colorSchemes;
inherit (inputs.nix-colors.lib-contrib { inherit pkgs; }) nixWallpaperFromScheme;
in
{
imports = [ inputs.nix-colors.homeManagerModule ];
config = lib.mkIf cfg.enable {
colorscheme = lib.mkDefault colorSchemes.gruvbox-material-dark-soft;
home.file.".colorscheme".text = config.colorscheme.slug;
wallpaper =
let
largest = f: xs: builtins.head (builtins.sort (a: b: a > b) (map f xs));
largestWidth = largest (x: x.width) config.monitors;
largestHeight = largest (x: x.height) config.monitors;
in
lib.mkDefault (nixWallpaperFromScheme
{
scheme = config.colorscheme;
width = largestWidth;
height = largestHeight;
logoScale = 4;
});
};
}

View file

@ -1,12 +0,0 @@
{ lib, ... }:
let inherit (lib) types mkOption;
in
{
options.wallpaper = mkOption {
type = types.path;
default = "";
description = ''
Wallpaper path
'';
};
}