treewide: format using nixfmt
Signed-off-by: Bloxx12 <charlie@charlieroot.dev> Change-Id: I6a6a69641c36f9763e104087a559c148d0449f00
This commit is contained in:
parent
f4464732e3
commit
e641dfa114
113 changed files with 1545 additions and 1019 deletions
|
@ -9,10 +9,24 @@
|
|||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
inherit (lib.options) mkOption literalExpression;
|
||||
inherit (lib.strings) toLower replaceStrings removePrefix hasPrefix isString;
|
||||
inherit (lib.types) str nullOr enum mkOptionType attrsOf coercedTo;
|
||||
inherit (lib.strings)
|
||||
toLower
|
||||
replaceStrings
|
||||
removePrefix
|
||||
hasPrefix
|
||||
isString
|
||||
;
|
||||
inherit (lib.types)
|
||||
str
|
||||
nullOr
|
||||
enum
|
||||
mkOptionType
|
||||
attrsOf
|
||||
coercedTo
|
||||
;
|
||||
|
||||
cfg = config.modules.style;
|
||||
|
||||
|
@ -24,16 +38,24 @@
|
|||
};
|
||||
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 {
|
||||
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"]);
|
||||
type = nullOr (enum [
|
||||
"Catppuccin Mocha"
|
||||
"Zenburn"
|
||||
"Black Metal Venom"
|
||||
"Gruvbox"
|
||||
]);
|
||||
description = "The colorscheme that should be used globally to theme your system.";
|
||||
default = "Catppuccin Mocha";
|
||||
};
|
||||
|
@ -83,11 +105,11 @@ in {
|
|||
};
|
||||
|
||||
variant = mkOption {
|
||||
type = enum ["dark" "light"];
|
||||
default =
|
||||
if builtins.substring 0 1 cfg.colorScheme.colors.base00 < "5"
|
||||
then "dark"
|
||||
else "light";
|
||||
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
|
||||
'';
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{pkgs, ...}: let
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
inherit (builtins) mapAttrs;
|
||||
|
||||
fancy-iosevka = pkgs.iosevka.override {
|
||||
|
@ -40,7 +41,8 @@
|
|||
};
|
||||
set = "Fancy";
|
||||
};
|
||||
in {
|
||||
in
|
||||
{
|
||||
# A (somewhat) sane list of fonts to be installed.
|
||||
fonts = {
|
||||
fontconfig = {
|
||||
|
@ -58,26 +60,26 @@ in {
|
|||
|
||||
# Set the defalt fonts. This was taken from raf,
|
||||
# many thanks.
|
||||
defaultFonts = let
|
||||
common = [
|
||||
"Iosevka Nerd Font"
|
||||
"Roboto Mono Nerd Font"
|
||||
"Fira Code Nerd Font"
|
||||
"Symbols Nerd Font"
|
||||
"Noto Color Emoji"
|
||||
"JetbrainsMono Nerd Font"
|
||||
];
|
||||
in
|
||||
defaultFonts =
|
||||
let
|
||||
common = [
|
||||
"Iosevka Nerd Font"
|
||||
"Roboto Mono Nerd Font"
|
||||
"Fira Code Nerd Font"
|
||||
"Symbols Nerd Font"
|
||||
"Noto Color Emoji"
|
||||
"JetbrainsMono Nerd Font"
|
||||
];
|
||||
in
|
||||
mapAttrs (_: fonts: fonts ++ common) {
|
||||
serif = ["Noto Serif"];
|
||||
sansSerif = ["Lexend"];
|
||||
emoji = ["Noto Color Emoji"];
|
||||
monospace = ["Iosevka Nerd Font"];
|
||||
serif = [ "Noto Serif" ];
|
||||
sansSerif = [ "Lexend" ];
|
||||
emoji = [ "Noto Color Emoji" ];
|
||||
monospace = [ "Iosevka Nerd Font" ];
|
||||
};
|
||||
};
|
||||
packages = builtins.attrValues {
|
||||
inherit
|
||||
(pkgs)
|
||||
inherit (pkgs)
|
||||
material-icons
|
||||
material-design-icons
|
||||
lexend
|
||||
|
@ -88,8 +90,7 @@ in {
|
|||
corefonts
|
||||
font-awesome
|
||||
;
|
||||
inherit
|
||||
(pkgs.nerd-fonts)
|
||||
inherit (pkgs.nerd-fonts)
|
||||
iosevka
|
||||
jetbrains-mono
|
||||
comic-shanns-mono
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# blatantly stolen from sioodmy, thanks :3
|
||||
{colors}:
|
||||
with colors; ''
|
||||
{ colors }:
|
||||
with colors;
|
||||
''
|
||||
@define-color accent_color #${base0D};
|
||||
@define-color accent_bg_color #${base0D};
|
||||
@define-color accent_fg_color #${base00};
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
inherit (builtins) toString isBool;
|
||||
inherit (lib.generators) toINI;
|
||||
inherit (lib.modules) mkIf;
|
||||
|
@ -15,12 +16,12 @@
|
|||
cfg = config.modules.theming.gtk;
|
||||
|
||||
toGtk3Ini = toINI {
|
||||
mkKeyValue = key: value: let
|
||||
value' =
|
||||
if isBool value
|
||||
then boolToString value
|
||||
else toString value;
|
||||
in "${escape ["="] key}=${value'}";
|
||||
mkKeyValue =
|
||||
key: value:
|
||||
let
|
||||
value' = if isBool value then boolToString value else toString value;
|
||||
in
|
||||
"${escape [ "=" ] key}=${value'}";
|
||||
};
|
||||
|
||||
gtkIni = {
|
||||
|
@ -34,7 +35,8 @@
|
|||
gtk-cursor-theme-name = "BreezeX-RosePine-Linux";
|
||||
gtk-theme-name = "Gruvbox-Dark";
|
||||
};
|
||||
in {
|
||||
in
|
||||
{
|
||||
options.modules.theming.gtk = {
|
||||
enable = mkEnableOption "Wether to enable GTK theming";
|
||||
theme = {
|
||||
|
@ -63,15 +65,15 @@ in {
|
|||
};
|
||||
};
|
||||
};
|
||||
config = let
|
||||
cursorSize = 32;
|
||||
in
|
||||
config =
|
||||
let
|
||||
cursorSize = 32;
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
programs.dconf.enable = true;
|
||||
environment = {
|
||||
systemPackages = builtins.attrValues {
|
||||
inherit
|
||||
(pkgs)
|
||||
inherit (pkgs)
|
||||
rose-pine-cursor
|
||||
gruvbox-gtk-theme
|
||||
papirus-icon-theme
|
||||
|
@ -83,31 +85,33 @@ in {
|
|||
XCURSOR_THEME = "BreezeX-RosePine-Linux";
|
||||
XCURSOR_SIZE = cursorSize;
|
||||
};
|
||||
etc = let
|
||||
css = import ./gtk-colors.nix {inherit (config.modules.style.colorScheme) colors;};
|
||||
in {
|
||||
"xdg/gtk-4.0/settings.ini".text = toGtk3Ini {
|
||||
Settings = gtkIni;
|
||||
};
|
||||
"xdg/gtk-3.0/settings.ini".text = toGtk3Ini {
|
||||
Settings = gtkIni;
|
||||
};
|
||||
"xdg/gtk-4.0/gtk.css".text = css;
|
||||
"xdg/gtk-3.0/gtk.css".text = css;
|
||||
etc =
|
||||
let
|
||||
css = import ./gtk-colors.nix { inherit (config.modules.style.colorScheme) colors; };
|
||||
in
|
||||
{
|
||||
"xdg/gtk-4.0/settings.ini".text = toGtk3Ini {
|
||||
Settings = gtkIni;
|
||||
};
|
||||
"xdg/gtk-3.0/settings.ini".text = toGtk3Ini {
|
||||
Settings = gtkIni;
|
||||
};
|
||||
"xdg/gtk-4.0/gtk.css".text = css;
|
||||
"xdg/gtk-3.0/gtk.css".text = css;
|
||||
|
||||
"xdg/gtk-2.0/gtkrc".text = ''
|
||||
gtk-cursor-theme-name = BreezeX-RosePine-Linux
|
||||
gtk-cursor-theme-size = ${toString cursorSize}
|
||||
gtk-theme-name = ${cfg.theme.name}
|
||||
gtk-icon-theme-name = ${cfg.iconTheme.name}
|
||||
gtk-font-name = Lexend 11
|
||||
'';
|
||||
"xdg/gtk-2.0/gtkrc".text = ''
|
||||
gtk-cursor-theme-name = BreezeX-RosePine-Linux
|
||||
gtk-cursor-theme-size = ${toString cursorSize}
|
||||
gtk-theme-name = ${cfg.theme.name}
|
||||
gtk-icon-theme-name = ${cfg.iconTheme.name}
|
||||
gtk-font-name = Lexend 11
|
||||
'';
|
||||
|
||||
"xdg/Xresources".text = ''
|
||||
Xcursor.size: ${toString cursorSize}
|
||||
Xcursor.theme: BreezeX-RosePine-Linux
|
||||
'';
|
||||
};
|
||||
"xdg/Xresources".text = ''
|
||||
Xcursor.size: ${toString cursorSize}
|
||||
Xcursor.theme: BreezeX-RosePine-Linux
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -3,13 +3,15 @@
|
|||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) str package;
|
||||
|
||||
cfg = config.modules.theming.qt;
|
||||
in {
|
||||
in
|
||||
{
|
||||
options.modules.theming.qt = {
|
||||
enable = mkEnableOption "qt theming";
|
||||
name = mkOption {
|
||||
|
|
|
@ -4,17 +4,19 @@
|
|||
pkgs,
|
||||
sources,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.options) mkEnableOption;
|
||||
|
||||
cfg = config.modules.theming.quickshell;
|
||||
in {
|
||||
in
|
||||
{
|
||||
options.modules.theming.quickshell.enable = mkEnableOption "quickshell";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
(pkgs.callPackage (sources.quickshell + "/default.nix") {})
|
||||
(pkgs.callPackage (sources.quickshell + "/default.nix") { })
|
||||
qt6.qtimageformats
|
||||
qt6.qt5compat
|
||||
qt6.qtmultimedia
|
||||
|
|
|
@ -1 +1 @@
|
|||
/run/user/1000/quickshell/vfs/97b86fe3cbb42714790f5e96b44b706b/.qmlls.ini
|
||||
/run/user/1000/quickshell/vfs/4f7a8066a49ba487f5b2754750896151/.qmlls.ini
|
Loading…
Add table
Add a link
Reference in a new issue