Compare commits

...

6 commits

21 changed files with 199 additions and 283 deletions

View file

@ -31,6 +31,7 @@ in {
polkit
ripgrep
smartmontools
television
trash-cli
util-linux
wireguard-tools

View file

@ -59,9 +59,6 @@
sound.enable = true;
};
usrEnv = {
theming = {
gtk.enable = true;
};
desktops.hyprland.enable = false;
programs = {
@ -83,10 +80,6 @@
};
};
style = {
gtk.enable = true;
qt.enable = true;
};
};
other = {
system.username = "cr";

View file

@ -33,7 +33,7 @@ in {
programs.nix-ld.enable = true;
services = {
fstrim.enable = lib.mkDefault true;
udisks2.enable = true;
};
meta = {
@ -71,7 +71,6 @@ in {
hardware.nvidia.enable = true;
};
usrEnv = {
theming.gtk.enable = true;
desktops.hyprland.enable = true;
programs = {

View file

@ -1,105 +0,0 @@
# NOTE: This module is entirely inspired by raf,
# most of the nix code is also taken from him,
# so please do check out his configuration!
# raf himself took it from misterio77
# and adapted it for his personal use,
# so look there too.
# <https://github.com/Misterio77/nix-colors/blob/main/module/colorscheme.nix>
{
config,
lib,
...
}: let
inherit (lib.options) mkOption literalExpression;
inherit (lib.types) str nullOr enum mkOptionType attrsOf coercedTo;
inherit (lib.strings) toLower replaceStrings removePrefix hasPrefix isString;
# inherit (lib) serializeTheme;
cfg = config.modules.style;
hexColorType = mkOptionType {
name = "hex-color";
descriptionClass = "noun";
description = "RGB color in hex format";
check = x: isString x && !(hasPrefix "#" x);
};
colorType = attrsOf (coercedTo str (removePrefix "#") hexColorType);
nameToSlug = name: toLower (replaceStrings [" "] ["-"] name);
getPaletteFromScheme = slug:
if builtins.pathExists ./palettes/${slug}.nix
then (import ./palettes/${slug}.nix).colorscheme.palette
else throw "The following colorscheme was imported but not found: ${slug}";
in {
options.modules.style = {
colorScheme = {
name = mkOption {
type = nullOr (enum ["Catppuccin Mocha" "Zenburn" "Black Metal Venom" "Gruvbox"]);
description = "The colorscheme that should be used globally to theme your system.";
default = "Gruvbox";
};
slug = mkOption {
type = str;
default = nameToSlug "${toString cfg.colorScheme.name}"; # toString to avoid type errors if null, returns ""
description = ''
The serialized slug for the colorScheme you are using.
Defaults to a lowercased version of the theme name with spaces
replaced with hyphens.
Must only be changed if the slug is expected to be different than
the serialized theme name."
'';
};
colors = mkOption {
type = colorType;
default = getPaletteFromScheme cfg.colorScheme.slug;
description = ''
An attribute set containing active colors of the system. Follows base16
scheme by default but can be expanded to base24 or anything "above" as
seen fit as the module option is actually not checked in any way
'';
example = literalExpression ''
{
base00 = "#1e1e2e"; # Base
base01 = "#181825"; # Mantle
base02 = "#313244"; # Surface0
base03 = "#45475a"; # Surface1
base04 = "#585b70"; # Surface2
base05 = "#cdd6f4"; # text
base06 = "#f5e0dc"; # rosewater
base07 = "#b4befe"; # lavender
base08 = "#f38ba8"; # red
base09 = "#fab387"; # peach
base0A = "#a6e3a1"; # yellow
base0B = "#94e2d5"; # green
base0C = "#94e2d5"; # teal
base0D = "#89b4fa"; # blue
base0E = "#cba6f7"; # mauve
base0F = "#f2cdcd"; # flamingo
}
'';
};
variant = mkOption {
type = enum ["dark" "light"];
default =
if builtins.substring 0 1 cfg.colorScheme.colors.base00 < "5"
then "dark"
else "light";
description = ''
Whether the scheme is dark or light
'';
};
alpha = mkOption {
type = str;
default = 1.0;
description = ''
The alpha value for the colorscheme
'';
};
};
};
}

View file

@ -1,12 +0,0 @@
{lib, ...}: let
inherit (lib) mkOption;
inherit (lib.types) package listOf;
in {
options.modules.system.fonts = {
# This defines extra fonts to be installed on the system.
extraFonts = mkOption {
type = listOf package;
default = [];
};
};
}

View file

@ -1,37 +0,0 @@
{
lib,
pkgs,
...
}: let
inherit (lib) mkOption mkEnableOption;
inherit (lib.types) str package;
in {
options.modules.usrEnv.style.gtk = {
enable = mkEnableOption "Wether to enable GTK theming";
theme = {
name = mkOption {
description = "The GTK theme name";
default = "Gruvbox-Dark-BL";
type = str;
};
package = mkOption {
description = "The GTK theme package";
default = pkgs.gruvbox-gtk-theme;
type = package;
};
};
iconTheme = {
description = "The GTK icon theme";
name = mkOption {
description = "The GTK icon theme name";
default = "Papirus-Dark";
type = str;
};
package = mkOption {
description = "The GTK icon theme package";
default = pkgs.catppuccin-papirus-folders;
type = package;
};
};
};
}

View file

@ -1,35 +0,0 @@
{
pkgs,
lib,
...
}: let
inherit (lib) mkOption;
inherit (lib.types) package str int;
in {
imports = [
./qt.nix
./gtk.nix
./fonts.nix
./colors.nix
];
options.modules.style = {
cursor = {
package = mkOption {
type = package;
default = pkgs.bibata-cursors;
description = "Cursor package";
};
name = mkOption {
type = str;
default = "Bibata-Modern-Classic";
description = "Cursor name";
};
size = mkOption {
type = int;
default = 32;
description = "Cursor size";
};
};
};
}

View file

@ -1,32 +0,0 @@
{
lib,
pkgs,
...
}: let
inherit (lib) mkEnableOption mkOption;
inherit (lib.types) str package;
in {
options.modules.usrEnv.style.qt = {
enable = mkEnableOption "qt theming";
name = mkOption {
description = "qt theme name";
default = "Catppuccin-Mocha-Dark";
type = str;
};
variant = mkOption {
description = "qt theme variant";
default = "mocha";
type = str;
};
accentColor = mkOption {
description = "accent colour for qt theme";
default = "green";
type = str;
};
package = mkOption {
description = "qt theme package";
default = pkgs.catppuccin-kde;
type = package;
};
};
}

View file

@ -16,10 +16,10 @@
title = "foot";
locked-title = "no";
# font = "Iosevka Custom:size=14";
# font-bold = "Iosevka Custom:size=14";
font = "Iosevka Nerd Font:size=14";
font-bold = "Iosevka Nerd Font:size=14";
font = "valiosevka:size=14";
font-bold = "valiosevka:size=14";
# font = "Iosevka Nerd Font:size=14";
# font-bold = "Iosevka Nerd Font:size=14";
line-height = 20;
letter-spacing = 0;

View file

@ -1 +1,105 @@
_: {}
# NOTE: This module is entirely inspired by raf,
# most of the nix code is also taken from him,
# so please do check out his configuration!
# raf himself took it from misterio77
# and adapted it for his personal use,
# so look there too.
# <https://github.com/Misterio77/nix-colors/blob/main/module/colorscheme.nix>
{
config,
lib,
...
}: let
inherit (lib.options) mkOption literalExpression;
inherit (lib.types) str nullOr enum mkOptionType attrsOf coercedTo;
inherit (lib.strings) toLower replaceStrings removePrefix hasPrefix isString;
# inherit (lib) serializeTheme;
cfg = config.modules.style;
hexColorType = mkOptionType {
name = "hex-color";
descriptionClass = "noun";
description = "RGB color in hex format";
check = x: isString x && !(hasPrefix "#" x);
};
colorType = attrsOf (coercedTo str (removePrefix "#") hexColorType);
nameToSlug = name: toLower (replaceStrings [" "] ["-"] name);
getPaletteFromScheme = slug:
if builtins.pathExists ./palettes/${slug}.nix
then (import ./palettes/${slug}.nix).colorscheme.palette
else throw "The following colorscheme was imported but not found: ${slug}";
in {
options.modules.style = {
colorScheme = {
name = mkOption {
type = nullOr (enum ["Catppuccin Mocha" "Zenburn" "Black Metal Venom" "Gruvbox"]);
description = "The colorscheme that should be used globally to theme your system.";
default = "Gruvbox";
};
slug = mkOption {
type = str;
default = nameToSlug "${toString cfg.colorScheme.name}"; # toString to avoid type errors if null, returns ""
description = ''
The serialized slug for the colorScheme you are using.
Defaults to a lowercased version of the theme name with spaces
replaced with hyphens.
Must only be changed if the slug is expected to be different than
the serialized theme name."
'';
};
colors = mkOption {
type = colorType;
default = getPaletteFromScheme cfg.colorScheme.slug;
description = ''
An attribute set containing active colors of the system. Follows base16
scheme by default but can be expanded to base24 or anything "above" as
seen fit as the module option is actually not checked in any way
'';
example = literalExpression ''
{
base00 = "#1e1e2e"; # Base
base01 = "#181825"; # Mantle
base02 = "#313244"; # Surface0
base03 = "#45475a"; # Surface1
base04 = "#585b70"; # Surface2
base05 = "#cdd6f4"; # text
base06 = "#f5e0dc"; # rosewater
base07 = "#b4befe"; # lavender
base08 = "#f38ba8"; # red
base09 = "#fab387"; # peach
base0A = "#a6e3a1"; # yellow
base0B = "#94e2d5"; # green
base0C = "#94e2d5"; # teal
base0D = "#89b4fa"; # blue
base0E = "#cba6f7"; # mauve
base0F = "#f2cdcd"; # flamingo
}
'';
};
variant = mkOption {
type = enum ["dark" "light"];
default =
if builtins.substring 0 1 cfg.colorScheme.colors.base00 < "5"
then "dark"
else "light";
description = ''
Whether the scheme is dark or light
'';
};
alpha = mkOption {
type = str;
default = 1.0;
description = ''
The alpha value for the colorscheme
'';
};
};
};
}

View file

@ -1,16 +1,21 @@
{pkgs, ...}: let
inherit (builtins) mapAttrs;
custom-iosevka = pkgs.iosevka.override {
valiosevka = pkgs.iosevka.override {
privateBuildPlan = {
family = "Iosevka Custom";
family = "valiosevka";
spacing = "normal";
serifs = "sans";
noCvSs = true;
exportGlyphNames = false;
variants.inherits = "ss15";
ligations.inherits = "dlig";
variants = {
inherits = "ss15";
design = {
e = "flat-crossbar";
f = "diagonal-tailed-crossbar-at-x-height";
};
};
};
set = "Fancy";
};
@ -29,6 +34,7 @@ in {
# Enable font hinting. Hinting aligns glyphs to pixel boundaries
# to improve rendering sharpness at low resolution.
hinting.enable = true;
# Set the defalt fonts. This was taken from raf,
# many thanks.
defaultFonts = let
@ -50,7 +56,6 @@ in {
packages = builtins.attrValues {
inherit
(pkgs)
# custom-iosevka
material-icons
material-design-icons
papirus-icon-theme
@ -69,6 +74,7 @@ in {
comic-shanns-mono
symbols-only
;
inherit valiosevka;
};
fontDir = {
# Whether to create a directory with links to all fonts in

View file

@ -1,12 +1,44 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.modules.usrEnv.style.gtk;
}: let
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) str package;
inherit (lib.modules) mkIf;
cfg = config.modules.theme.gtk;
in {
options.modules.theme.gtk = {
enable = mkEnableOption "Wether to enable GTK theming";
theme = {
name = mkOption {
description = "The GTK theme name";
default = "Gruvbox-Dark-BL";
type = str;
};
package = mkOption {
description = "The GTK theme package";
default = pkgs.gruvbox-gtk-theme;
type = package;
};
};
iconTheme = {
description = "The GTK icon theme";
name = mkOption {
description = "The GTK icon theme name";
default = "Papirus-Dark";
type = str;
};
package = mkOption {
description = "The GTK icon theme package";
default = pkgs.catppuccin-papirus-folders;
type = package;
};
};
};
config = mkIf cfg.enable {
programs.dconf.enable = true; # NOTE: we need this or gtk breaks
# NOTE: we need this or gtk breaks
programs.dconf.enable = true;
};
}

View file

@ -3,20 +3,37 @@
lib,
pkgs,
...
}:
with lib; let
theme = {
package = pkgs.gruvbox-gtk-theme;
name = "Gruvbox-Dark-BL";
};
}: let
inherit (lib.modules) mkIf;
inherit (lib) mkEnableOption mkOption;
inherit (lib.types) str package;
cfg = config.modules.usrEnv.style.qt;
in {
config = mkIf cfg.enable {
environment.sessionVariables = {QT_QPA_PLATFORMTHEME = "qt5ct";};
environment.variables = {
QT_STYLE_OVERRIDE = lib.mkForce "kvantum";
GTK_THEME = theme.name;
options.modules.usrEnv.style.qt = {
enable = mkEnableOption "qt theming";
name = mkOption {
description = "qt theme name";
default = "Catppuccin-Mocha-Dark";
type = str;
};
variant = mkOption {
description = "qt theme variant";
default = "mocha";
type = str;
};
accentColor = mkOption {
description = "accent colour for qt theme";
default = "green";
type = str;
};
package = mkOption {
description = "qt theme package";
default = pkgs.catppuccin-kde;
type = package;
};
};
config =
mkIf cfg.enable {
};
}

View file

@ -54,20 +54,16 @@ in {
binde = [
# window focus
"$mainMod, H, hy3:movefocus, l"
"$mainMod, J, hy3:movefocus, d"
"$mainMod, K, hy3:movefocus, u"
"$mainMod, L, hy3:movefocus, r"
"$mainMod, H, movefocus, l"
"$mainMod, J, movefocus, d"
"$mainMod, K, movefocus, u"
"$mainMod, L, movefocus, r"
# Move Windows
"$mainMod SHIFT, H, hy3:movewindow, l"
"$mainMod SHIFT, J, hy3:movewindow, d"
"$mainMod SHIFT, K, hy3:movewindow, u"
"$mainMod SHIFT, L, hy3:movewindow, r"
"$mainMod, T, hy3:makegroup, tab"
"$mainMod, M, hy3:makegroup, h"
"$mainMod, C, hy3:makegroup, v"
"$mainMod SHIFT, H, movewindow, l"
"$mainMod SHIFT, J, movewindow, d"
"$mainMod SHIFT, K, movewindow, u"
"$mainMod SHIFT, L, movewindow, r"
];
# Media controls

View file

@ -3,14 +3,14 @@
pkgs,
...
}: let
inherit (config.modules.style) cursor;
# inherit (config.modules.style) cursor;
inherit (builtins) toString;
in {
programs.hyprland.settings = {
# Hyprland settings
# Programs which get executed at Hyprland start.
exec-once = [
"hyprctl setcursor ${cursor.name} ${toString cursor.size}"
# "hyprctl setcursor ${cursor.name} ${toString cursor.size}"
"[workspace special:keepassxc; silent;tile] ${pkgs.keepassxc}/bin/keepassxc"
"[workspace special:audio; silent;tile] ${pkgs.pwvucontrol}/bin/pwvucontrol"

View file

@ -27,8 +27,6 @@ in {
portalPackage = pkgs.xdg-desktop-portal-hyprland;
plugins = [
pkgs.hyprlandPlugins.hyprsplit
pkgs.hyprlandPlugins.hy3
# pkgs.hyprlandPlugins.hypr-dynamic-cursors
];
};
# xdg Portal

View file

@ -47,7 +47,7 @@ in {
};
general = {
layout = "hy3";
layout = "dwindle";
gaps_in = 0;
gaps_out = 0;
border_size = 2;
@ -61,15 +61,6 @@ in {
num_workspaces = 10;
persistent_workspaces = true;
};
hy3 = {
tabs = {
height = 13;
padding = 0;
radius = 0;
border_width = 1;
blur = false;
};
};
dynamic-cursors = {
enabled = true;