From 77fc328c84d45f51739547e81d59fbb080d0f418 Mon Sep 17 00:00:00 2001 From: Jan-Bulthuis Date: Mon, 17 Feb 2025 15:38:32 +0100 Subject: [PATCH] Moved desktop config --- user-modules/browser/firefox/default.nix | 4 +-- user-modules/browser/qutebrowser/default.nix | 2 +- user-modules/btop/default.nix | 2 +- user-modules/default.nix | 1 - user-modules/desktop/custom/bar/waybar.nix | 2 +- .../desktop/custom/window-manager/river.nix | 6 ++--- user-modules/desktop/theming/default.nix | 8 +++--- .../desktop/theming/themes/catppuccin.nix | 6 ++--- .../desktop/theming/themes/gruvbox.nix | 6 ++--- user-modules/desktop/theming/themes/nord.nix | 6 ++--- .../desktop/theming/themes/oxocarbon.nix | 6 ++--- .../desktop/theming/themes/papercolor.nix | 6 ++--- .../desktop/theming/themes/sakura.nix | 6 ++--- user-modules/fontconfig/default.nix | 12 +++++---- user-modules/mako/default.nix | 2 +- user-modules/neovim/default.nix | 2 +- user-modules/rofi/default.nix | 2 +- user-modules/terminal/foot/default.nix | 4 +-- user-modules/vscode/default.nix | 4 +-- user-modules/zathura/default.nix | 2 +- users/jan.nix | 26 +++++++++---------- 21 files changed, 56 insertions(+), 59 deletions(-) diff --git a/user-modules/browser/firefox/default.nix b/user-modules/browser/firefox/default.nix index 435d1a0..c5f480d 100644 --- a/user-modules/browser/firefox/default.nix +++ b/user-modules/browser/firefox/default.nix @@ -50,14 +50,14 @@ in extensions = with pkgs.nur.repos.rycee.firefox-addons; [ ublock-origin - tridactyl # TODO: Add toggle for this extension? + # tridactyl # TODO: Add toggle for this extension? ]; # Theming userChrome = readFile ( pkgs.substituteAll { src = ./userChrome.css; - colors = config.theming.colorsCSS; + colors = config.desktop.theming.colorsCSS; } ); diff --git a/user-modules/browser/qutebrowser/default.nix b/user-modules/browser/qutebrowser/default.nix index 3e7220d..e454627 100644 --- a/user-modules/browser/qutebrowser/default.nix +++ b/user-modules/browser/qutebrowser/default.nix @@ -8,7 +8,7 @@ with lib; let cfg = config.modules.qutebrowser; - theme = config.theming; + theme = config.desktop.theming; in { options.modules.qutebrowser = { diff --git a/user-modules/btop/default.nix b/user-modules/btop/default.nix index 0f8981e..f0e1efc 100644 --- a/user-modules/btop/default.nix +++ b/user-modules/btop/default.nix @@ -8,7 +8,7 @@ with lib; let cfg = config.modules.btop; - colors = config.theming.schemeColors; + colors = config.desktop.theming.schemeColors; in { options.modules.btop = { diff --git a/user-modules/default.nix b/user-modules/default.nix index 5d77398..16635cf 100644 --- a/user-modules/default.nix +++ b/user-modules/default.nix @@ -29,7 +29,6 @@ ./spotify/default.nix ./terminal/default.nix ./terminal/foot/default.nix - ./theming/default.nix ./vscode/default.nix ./whatsapp/default.nix ./winbox/default.nix diff --git a/user-modules/desktop/custom/bar/waybar.nix b/user-modules/desktop/custom/bar/waybar.nix index a872cea..92406c7 100644 --- a/user-modules/desktop/custom/bar/waybar.nix +++ b/user-modules/desktop/custom/bar/waybar.nix @@ -8,7 +8,7 @@ with lib; let cfg = config.modules.waybar; - theme = config.theming; + theme = config.desktop.theming; colors = theme.colors; in { diff --git a/user-modules/desktop/custom/window-manager/river.nix b/user-modules/desktop/custom/window-manager/river.nix index 0407d6d..c2fe126 100644 --- a/user-modules/desktop/custom/window-manager/river.nix +++ b/user-modules/desktop/custom/window-manager/river.nix @@ -65,7 +65,7 @@ in settings = let layout = "filtile"; - layoutOptions = "-outer-padding ${toString config.theming.layout.windowPadding} -view-padding ${toString config.theming.layout.windowPadding} -main-ratio 0.5"; + layoutOptions = "-outer-padding ${toString config.desktop.theming.layout.windowPadding} -view-padding ${toString config.desktop.theming.layout.windowPadding} -main-ratio 0.5"; modes = [ "normal" "locked" @@ -83,7 +83,7 @@ in ]; waylockOptions = "-init-color 0x${colors.bg} -input-color 0x${colors.border-focused} -fail-color 0x${colors.bg}"; - colors = config.theming.colors; + colors = config.desktop.theming.colors; # Quick pow function pow2 = power: if power != 0 then 2 * (pow2 (power - 1)) else 1; @@ -103,7 +103,7 @@ in xcursor-theme = "BreezeX-RosePine-Linux 24"; keyboard-layout = "-options \"caps:escape\" us"; - border-width = toString config.theming.layout.borderSize; + border-width = toString config.desktop.theming.layout.borderSize; background-color = "0x${colors.bg}"; border-color-focused = "0x${colors.fg}"; border-color-unfocused = "0x${colors.border-unfocused}"; # TODO: Change to use named color; diff --git a/user-modules/desktop/theming/default.nix b/user-modules/desktop/theming/default.nix index 5ee18d2..56950ea 100644 --- a/user-modules/desktop/theming/default.nix +++ b/user-modules/desktop/theming/default.nix @@ -7,7 +7,7 @@ with lib; let - cfg = config.theming; + cfg = config.desktop.theming; # Font module type fontModule = types.submodule { @@ -101,11 +101,9 @@ in options.desktop.theming = let - colors = config.theming.schemeColors; + colors = config.desktop.theming.schemeColors; in { - enable = mkEnableOption "theming"; - darkMode = mkOption { type = types.bool; default = false; @@ -250,7 +248,7 @@ in }; }; - config = mkIf config.modules.theming.enable { + config = { # Enable fontconfig modules.fontconfig.enable = true; diff --git a/user-modules/desktop/theming/themes/catppuccin.nix b/user-modules/desktop/theming/themes/catppuccin.nix index c62b653..91faa44 100644 --- a/user-modules/desktop/theming/themes/catppuccin.nix +++ b/user-modules/desktop/theming/themes/catppuccin.nix @@ -7,11 +7,11 @@ with lib; let - cfg = config.theming.themes.catppuccin; + cfg = config.desktop.theming.themes.catppuccin; in { options = { - theming.themes.catppuccin = { + desktop.theming.themes.catppuccin = { enable = mkEnableOption "catppuccin"; flavor = mkOption { type = types.enum [ @@ -26,7 +26,7 @@ in }; }; - config.theming = mkIf cfg.enable { + config.desktop.theming = mkIf cfg.enable { darkMode = (cfg.flavor != "latte"); colorScheme = "${pkgs.base16-schemes}/share/themes/catppuccin-${cfg.flavor}.yaml"; }; diff --git a/user-modules/desktop/theming/themes/gruvbox.nix b/user-modules/desktop/theming/themes/gruvbox.nix index 499a23a..683fcaa 100644 --- a/user-modules/desktop/theming/themes/gruvbox.nix +++ b/user-modules/desktop/theming/themes/gruvbox.nix @@ -7,12 +7,12 @@ with lib; let - cfg = config.theming.themes.gruvbox; + cfg = config.desktop.theming.themes.gruvbox; mode = if cfg.darkMode then "dark" else "light"; in { options = { - theming.themes.gruvbox = { + desktop.theming.themes.gruvbox = { enable = mkEnableOption "gruvbox-hard"; darkMode = mkEnableOption "dark mode"; contrast = mkOption { @@ -27,7 +27,7 @@ in }; }; - config.theming = mkIf cfg.enable { + config.desktop.theming = mkIf cfg.enable { darkMode = cfg.darkMode; colorScheme = "${pkgs.base16-schemes}/share/themes/gruvbox-${mode}-${cfg.contrast}.yaml"; }; diff --git a/user-modules/desktop/theming/themes/nord.nix b/user-modules/desktop/theming/themes/nord.nix index ec46ad0..4287ccb 100644 --- a/user-modules/desktop/theming/themes/nord.nix +++ b/user-modules/desktop/theming/themes/nord.nix @@ -7,18 +7,18 @@ with lib; let - cfg = config.theming.themes.nord; + cfg = config.desktop.theming.themes.nord; mode = if cfg.darkMode then "" else "-light"; in { options = { - theming.themes.nord = { + desktop.theming.themes.nord = { enable = mkEnableOption "nord"; darkMode = mkEnableOption "dark mode"; }; }; - config.theming = mkIf cfg.enable { + config.desktop.theming = mkIf cfg.enable { darkMode = cfg.darkMode; colorScheme = "${pkgs.base16-schemes}/share/themes/nord${mode}.yaml"; }; diff --git a/user-modules/desktop/theming/themes/oxocarbon.nix b/user-modules/desktop/theming/themes/oxocarbon.nix index 8d6c345..1bfccbc 100644 --- a/user-modules/desktop/theming/themes/oxocarbon.nix +++ b/user-modules/desktop/theming/themes/oxocarbon.nix @@ -7,18 +7,18 @@ with lib; let - cfg = config.theming.themes.oxocarbon; + cfg = config.desktop.theming.themes.oxocarbon; mode = if cfg.darkMode then "dark" else "light"; in { options = { - theming.themes.oxocarbon = { + desktop.theming.themes.oxocarbon = { enable = mkEnableOption "oxocarbon"; darkMode = mkEnableOption "dark mode"; }; }; - config.theming = mkIf cfg.enable { + config.desktop.theming = mkIf cfg.enable { darkMode = cfg.darkMode; colorScheme = "${pkgs.base16-schemes}/share/themes/oxocarbon-${mode}.yaml"; }; diff --git a/user-modules/desktop/theming/themes/papercolor.nix b/user-modules/desktop/theming/themes/papercolor.nix index 645326c..c0005ae 100644 --- a/user-modules/desktop/theming/themes/papercolor.nix +++ b/user-modules/desktop/theming/themes/papercolor.nix @@ -7,18 +7,18 @@ with lib; let - cfg = config.theming.themes.papercolor; + cfg = config.desktop.theming.themes.papercolor; mode = if cfg.darkMode then "dark" else "light"; in { options = { - theming.themes.papercolor = { + desktop.theming.themes.papercolor = { enable = mkEnableOption "papercolor"; darkMode = mkEnableOption "dark mode"; }; }; - config.theming = mkIf cfg.enable { + config.desktop.theming = mkIf cfg.enable { darkMode = cfg.darkMode; colorScheme = "${pkgs.base16-schemes}/share/themes/papercolor-${mode}.yaml"; }; diff --git a/user-modules/desktop/theming/themes/sakura.nix b/user-modules/desktop/theming/themes/sakura.nix index 54c9bb2..8492edd 100644 --- a/user-modules/desktop/theming/themes/sakura.nix +++ b/user-modules/desktop/theming/themes/sakura.nix @@ -7,16 +7,16 @@ with lib; let - cfg = config.theming.themes.sakura; + cfg = config.desktop.theming.themes.sakura; in { options = { - theming.themes.sakura = { + desktop.theming.themes.sakura = { enable = mkEnableOption "sakura"; }; }; - config.theming = mkIf cfg.enable { + config.desktop.theming = mkIf cfg.enable { darkMode = false; colorScheme = "${pkgs.base16-schemes}/share/themes/sakura.yaml"; }; diff --git a/user-modules/fontconfig/default.nix b/user-modules/fontconfig/default.nix index 0e865e0..78f0d8a 100644 --- a/user-modules/fontconfig/default.nix +++ b/user-modules/fontconfig/default.nix @@ -21,7 +21,9 @@ let ''; configContent = concatStrings ( - map (font: aliasConfig config.theming.fonts.pkgs.${font}) config.theming.fonts.installed + map ( + font: aliasConfig config.desktop.theming.fonts.pkgs.${font} + ) config.desktop.theming.fonts.installed ); in { @@ -34,10 +36,10 @@ in enable = true; defaultFonts = { - serif = [ config.theming.fonts.serif.name ]; - sansSerif = [ config.theming.fonts.sansSerif.name ]; - monospace = [ config.theming.fonts.monospace.name ]; - emoji = [ config.theming.fonts.emoji.name ]; + serif = [ config.desktop.theming.fonts.serif.name ]; + sansSerif = [ config.desktop.theming.fonts.sansSerif.name ]; + monospace = [ config.desktop.theming.fonts.monospace.name ]; + emoji = [ config.desktop.theming.fonts.emoji.name ]; }; }; diff --git a/user-modules/mako/default.nix b/user-modules/mako/default.nix index 2c0f667..bea449c 100644 --- a/user-modules/mako/default.nix +++ b/user-modules/mako/default.nix @@ -8,7 +8,7 @@ with lib; let cfg = config.modules.mako; - theme = config.theming; + theme = config.desktop.theming; colors = theme.colors; in { diff --git a/user-modules/neovim/default.nix b/user-modules/neovim/default.nix index ad51a74..4602022 100644 --- a/user-modules/neovim/default.nix +++ b/user-modules/neovim/default.nix @@ -8,7 +8,7 @@ with lib; let cfg = config.modules.neovim; - theme = config.theming; + theme = config.desktop.theming; colors = theme.colors; in { diff --git a/user-modules/rofi/default.nix b/user-modules/rofi/default.nix index 66344c0..0b1d8a6 100644 --- a/user-modules/rofi/default.nix +++ b/user-modules/rofi/default.nix @@ -8,7 +8,7 @@ with lib; let cfg = config.modules.rofi; - theme = config.theming; + theme = config.desktop.theming; colors = theme.colors; in { diff --git a/user-modules/terminal/foot/default.nix b/user-modules/terminal/foot/default.nix index 2648ca5..3588481 100644 --- a/user-modules/terminal/foot/default.nix +++ b/user-modules/terminal/foot/default.nix @@ -20,8 +20,8 @@ in settings = { main = let - font = config.theming.fonts.monospace.name; - size = toString config.theming.fonts.monospace.recommendedSize; + font = config.desktop.theming.fonts.monospace.name; + size = toString config.desktop.theming.fonts.monospace.recommendedSize; in { font = mkForce "${font}:style=Regular:size=${size}"; diff --git a/user-modules/vscode/default.nix b/user-modules/vscode/default.nix index 6f74fa9..dea277f 100644 --- a/user-modules/vscode/default.nix +++ b/user-modules/vscode/default.nix @@ -8,7 +8,7 @@ with lib; let cfg = config.modules.vscode; - theme = config.theming; + theme = config.desktop.theming; in { options.modules.vscode = { @@ -31,7 +31,7 @@ in "vscode-extension-ms-vsliveshare-vsliveshare" ]; - theming.fonts.extraFonts = [ cfg.codeFont ]; + desktop.theming.fonts.extraFonts = [ cfg.codeFont ]; programs.vscode = { enable = true; diff --git a/user-modules/zathura/default.nix b/user-modules/zathura/default.nix index f46bb7f..dbbe6af 100644 --- a/user-modules/zathura/default.nix +++ b/user-modules/zathura/default.nix @@ -7,7 +7,7 @@ let cfg = config.modules.zathura; - colors = config.theming.colors; + colors = config.desktop.theming.colors; in { options.modules.zathura.enable = lib.mkEnableOption "zathura"; diff --git a/users/jan.nix b/users/jan.nix index 350dadd..ea1e6de 100644 --- a/users/jan.nix +++ b/users/jan.nix @@ -25,17 +25,17 @@ ]; # Desktop environments - desktops = - let - in - { - "River Dark" = { - type = "custom"; - theming = { }; - config = { }; - extraConfig = { }; - }; - }; + # desktops = + # let + # in + # { + # "River Dark" = { + # type = "custom"; + # theming = { }; + # config = { }; + # extraConfig = { }; + # }; + # }; # Enabled modules modules = { @@ -121,11 +121,9 @@ # Theme configuration desktop.theming = let - fontpkgs = config.theming.fonts.pkgs; + fontpkgs = config.desktop.theming.fonts.pkgs; in { - enable = true; - # Fonts fonts.serif = fontpkgs."DejaVu Serif"; fonts.sansSerif = fontpkgs."DejaVu Sans";