feat: simplified themes module

This commit is contained in:
Nick 2025-01-18 03:50:54 -06:00
parent b0fdd1d958
commit a5ec879db0
119 changed files with 2045 additions and 4624 deletions

View file

@ -1,37 +1,68 @@
let
modulesPath = ./modules;
moduleImport = path: nameTransform:
builtins.listToAttrs (map (name: {
name = nameTransform name;
value = import (path + "/${name}");
}) (builtins.filter (name:
(builtins.readDir path).${name} == "regular"
&& builtins.match ".*\\.nix$" name != null)
(builtins.attrNames (builtins.readDir path))));
modules = moduleImport modulesPath
(name: builtins.replaceStrings [ ".nix" ] [ "" ] name) // (path:
builtins.listToAttrs (map (name: {
name = name;
value = import (path + "/${name}");
}) (builtins.filter (name: (builtins.readDir path).${name} == "directory")
(builtins.attrNames (builtins.readDir path))))) modulesPath;
in {
moduleImport =
path: nameTransform:
builtins.listToAttrs (
map
(name: {
name = nameTransform name;
value = import (path + "/${name}");
})
(
builtins.filter (
name: (builtins.readDir path).${name} == "regular" && builtins.match ".*\\.nix$" name != null
) (builtins.attrNames (builtins.readDir path))
)
);
modules =
moduleImport modulesPath (name: builtins.replaceStrings [ ".nix" ] [ "" ] name)
// (
path:
builtins.listToAttrs (
map
(name: {
name = name;
value = import (path + "/${name}");
})
(
builtins.filter (name: (builtins.readDir path).${name} == "directory") (
builtins.attrNames (builtins.readDir path)
)
)
)
)
modulesPath;
in
{
flake.nixosModules = {
personal = {
imports = builtins.attrValues {
inherit (modules)
android audio bluetooth corectrl dconf disks firejail flatpak fonts
printing steam sysstat virtualization;
android
audio
bluetooth
corectrl
dconf
disks
firejail
flatpak
fonts
printing
steam
sysstat
virtualization
;
};
};
desktop = {
imports = builtins.attrValues {
inherit (modules)
syncthing ollama
syncthing
ollama
# plasma
# sddm
;
;
};
};
@ -39,13 +70,27 @@ in {
imports = builtins.attrValues { inherit (modules) hyprland; };
};
server = { imports = builtins.attrValues { inherit (modules) services; }; };
server = {
imports = builtins.attrValues { inherit (modules) services; };
};
shared = {
imports = builtins.attrValues {
inherit (modules)
accounts doas environment gvfs home-manager locale nh nix rsyncd sops
ssh system xserver;
accounts
doas
environment
gvfs
home-manager
locale
nh
nix
rsyncd
sops
ssh
system
xserver
;
};
};
};

View file

@ -2,12 +2,12 @@
pkgs,
config,
...
}: {
}:
{
environment = {
# enableAllTerminfo = true;
systemPackages = builtins.attrValues {
inherit
(pkgs)
inherit (pkgs)
git
grim
pijul
@ -20,6 +20,7 @@
variables = {
VIDEO_PLAYER = "mpv";
EDITOR = "hx";
TERM = "ghostty";
WLR_NO_HARDWARE_CURSORS = "1";
WLR_DRM_NO_ATOMIC = "1";
NIXPKGS_ALLOW_INSECURE = "1";

View file

@ -2,24 +2,25 @@
pkgs,
flake,
...
}: let
inherit
(flake.config.aesthetics.themes)
}:
let
inherit (flake.config.aesthetics.themes)
font
;
in {
in
{
fonts = {
fontconfig = {
enable = true;
defaultFonts = {
serif = [
font
font.name
];
monospace = [
font
font.name
];
sansSerif = [
font
font.name
];
emoji = [
"Noto Fonts Color Emoji"
@ -28,14 +29,12 @@ in {
antialias = true;
};
packages = builtins.attrValues {
inherit
(pkgs)
inherit (pkgs)
noto-fonts-color-emoji
dosis
iosevka
;
inherit
(pkgs.nerd-fonts)
inherit (pkgs.nerd-fonts)
monaspace
fantasque-sans-mono
;

View file

@ -3,12 +3,13 @@
flake,
lib,
...
}: let
inherit
(flake.config.aesthetics.themes)
}:
let
inherit (flake.config.aesthetics.themes)
font
;
in {
in
{
programs.regreet = {
enable = true;
package = pkgs.greetd.regreet;
@ -19,7 +20,7 @@ in {
GTK = {
application_prefer_dark_theme = true;
cursor_theme_name = lib.mkForce "catppuccin-macchiato-dark-cursors";
font_name = lib.mkForce "${font} 11";
font_name = lib.mkForce "${font.name} 11";
icon_theme_name = lib.mkForce "Papirus-Dark";
theme_name = lib.mkForce "catppuccin-macchiato-mauve-compact";
};