From 101b89f3781ad3ecd7e126b5cfe53b21e679b226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thea=20Sch=C3=B6bl?= Date: Wed, 24 Apr 2024 11:23:26 +0200 Subject: [PATCH] feat: test stuff --- hosts/MONSTER/default.nix | 1 + .../home-manager/desktops/hyprland/kitty.nix | 4 +- modules/home-manager/packages/default.nix | 2 + modules/nixos/default.nix | 2 + modules/nixos/theming/kitty.conf | 28 ++++++++ modules/nixos/theming/matugen.nix | 68 +++++++++++++++++++ overlays/asztal/shell.nix | 4 ++ 7 files changed, 106 insertions(+), 3 deletions(-) create mode 100644 modules/nixos/theming/kitty.conf create mode 100644 modules/nixos/theming/matugen.nix create mode 100644 overlays/asztal/shell.nix diff --git a/hosts/MONSTER/default.nix b/hosts/MONSTER/default.nix index 0096bde..32ea8db 100644 --- a/hosts/MONSTER/default.nix +++ b/hosts/MONSTER/default.nix @@ -47,6 +47,7 @@ }; }; + theming.matugen.enable = true; desktops = { hyprland.enable = true; # gamescope.enable = true; diff --git a/modules/home-manager/desktops/hyprland/kitty.nix b/modules/home-manager/desktops/hyprland/kitty.nix index eee3d74..6f220e4 100644 --- a/modules/home-manager/desktops/hyprland/kitty.nix +++ b/modules/home-manager/desktops/hyprland/kitty.nix @@ -6,11 +6,9 @@ symbol_map U+23FB-U+23FE,U+2665,U+26A1,U+2B58,U+E000-U+E00A,U+E0A0-U+E0A3,U+E0B0-U+E0D4,U+E200-U+E2A9,U+E300-U+E3E3,U+E5FA-U+E6AA,U+E700-U+E7C5,U+EA60-U+EBEB,U+F000-U+F2E0,U+F300-U+F32F,U+F400-U+F4A9,U+F500-U+F8FF,U+F0001-U+F1AF0 Symbols Nerd Font Mono font_size 13 - - include ./current-theme.conf ''; settings = { - background_opacity = "0.8"; + #background_opacity = "0.8"; window_padding_width = 10; }; } diff --git a/modules/home-manager/packages/default.nix b/modules/home-manager/packages/default.nix index 684bd38..249e44e 100644 --- a/modules/home-manager/packages/default.nix +++ b/modules/home-manager/packages/default.nix @@ -7,6 +7,8 @@ lorri vulnix + matugen # TODO + # browsers chromium brave diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index b1903f3..c818a9d 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -22,6 +22,8 @@ ./locales/theaninova.nix + ./theming/matugen.nix + ./usecases/gaming.nix ./usecases/3d-printing.nix ./usecases/development.nix diff --git a/modules/nixos/theming/kitty.conf b/modules/nixos/theming/kitty.conf new file mode 100644 index 0000000..ae96c85 --- /dev/null +++ b/modules/nixos/theming/kitty.conf @@ -0,0 +1,28 @@ +background {{colors.surface.default.hex}} +foreground {{colors.on_surface.default.hex}} + +selection_background {{colors.primary.default.hex}} +selection_foreground {{colors.on_primary.default.hex}} + +url_color {{colors.tertiary.default.hex}} +cursor {{colors.on_surface.default.hex}} + +# normal +color0 {{colors.surface.default.hex}} +color1 {{harmonized_colors.red.hex}} +color2 {{harmonized_colors.green.hex}} +color3 {{harmonized_colors.yellow.hex}} +color4 {{harmonized_colors.blue.hex}} +color5 {{harmonized_colors.magenta.hex}} +color6 {{harmonized_colors.cyan.hex}} +color7 {{colors.on_surface.default.hex}} + +# bright +color8 {{colors.surface_variant.default.hex}} +color9 {{harmonized_colors.bright_red.hex}} +color10 {{harmonized_colors.bright_green.hex}} +color11 {{harmonized_colors.bright_yellow.hex}} +color12 {{harmonized_colors.bright_blue.hex}} +color13 {{harmonized_colors.bright_magenta.hex}} +color14 {{harmonized_colors.bright_cyan.hex}} +color15 {{colors.on_surface_variant.default.hex}} diff --git a/modules/nixos/theming/matugen.nix b/modules/nixos/theming/matugen.nix new file mode 100644 index 0000000..9869b19 --- /dev/null +++ b/modules/nixos/theming/matugen.nix @@ -0,0 +1,68 @@ +{ + pkgs, + lib, + config, + username, + ... +}: +with lib; + +let + cfg = config.theming.matugen; + homeCfg = config.home-manager.users.${username}; +in +{ + options.theming.matugen = { + enable = mkEnableOption "Enable dynamic theming through matugen"; + }; + + config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + matugen + swww + ]; + + home-manager.users.${username} = { + programs.kitty.extraConfig = '' + include ${homeCfg.xdg.configHome}/kitty/theme.conf + ''; + + xdg.configFile."matugen/config.toml".source = (pkgs.formats.toml { }).generate "matugen" { + config = { + reload_apps = true; + reload_apps_list = { + kitty = true; + gtk_theme = true; + waybar = false; + dunst = false; + }; + + set_wallpaper = true; + wallpaper_tool = "Swww"; + + colors_to_harmonize = { + red = "#ff0000"; + green = "#00ff00"; + yellow = "#ffff00"; + blue = "#0000ff"; + magenta = "#ff00ff"; + cyan = "#00ffff"; + bright_red = "#ff9999"; + bright_green = "#99ff99"; + bright_yellow = "#ffff99"; + bright_blue = "#9999ff"; + bright_magenta = "#ff99ff"; + bright_cyan = "#99ffff"; + }; + }; + + templates = { + kitty = { + input_path = ./kitty.conf; + output_path = "${homeCfg.xdg.configHome}/kitty/theme.conf"; + }; + }; + }; + }; + }; +} diff --git a/overlays/asztal/shell.nix b/overlays/asztal/shell.nix new file mode 100644 index 0000000..75a6fa8 --- /dev/null +++ b/overlays/asztal/shell.nix @@ -0,0 +1,4 @@ +{ pkgs ? import {} }: + pkgs.mkShell { + buildInputs = with pkgs; [ nodejs_18 nodePackages.pnpm ]; + }