From 1d8361356e705644ccd3ea694a98e6d8c2fb613a Mon Sep 17 00:00:00 2001 From: uttarayan21 Date: Mon, 4 Mar 2024 04:01:14 +0530 Subject: [PATCH] [feat] Add catppuccin theme getter --- config/nix/common/home.nix | 24 +++++------ config/nix/common/wezterm.nix | 2 +- config/nix/flake.nix | 47 +++++++++++++++------- config/nix/linux/default.nix | 5 ++- config/nix/linux/hyprland.nix | 31 +++++++++------ config/nix/linux/ironbar/default.nix | 2 +- config/nix/nixos/configuration.nix | 27 +++++++++++++ config/nix/themes/catppuccin.nix | 26 ++++++++++++ config/wezterm/wezterm.lua | 59 ---------------------------- 9 files changed, 120 insertions(+), 103 deletions(-) create mode 100644 config/nix/themes/catppuccin.nix delete mode 100644 config/wezterm/wezterm.lua diff --git a/config/nix/common/home.nix b/config/nix/common/home.nix index 5b92d357..1506422c 100644 --- a/config/nix/common/home.nix +++ b/config/nix/common/home.nix @@ -12,6 +12,9 @@ in ] ++ (if device.isLinux then [ ../linux ] else [ ]) ++ (if !lazy then [ ./nvim ] else [ ]); + + services.swayosd.enable = true; + home.packages = with pkgs; [ yt-dlp @@ -46,11 +49,9 @@ in (nerdfonts.override { fonts = [ "Hasklig" ]; }) mpv ] ++ (if device.isLinux then [ - openssl - openssl.dev + polkit-kde-agent dig mullvad - kdeconnect steam-run (pkgs.catppuccin-gtk.override { variant = "mocha"; @@ -63,7 +64,6 @@ in flavor = "mocha"; }) swaynotificationcenter - openocd-rp2040 usbutils picotool handlr-regex @@ -190,17 +190,11 @@ in enable = true; config = { theme = "catppuccin"; }; themes = { - catppuccin = - let flavor = "mocha"; - in { - src = pkgs.fetchFromGitHub { - owner = "catppuccin"; - repo = "bat"; - rev = "main"; - sha256 = "sha256-6WVKQErGdaqb++oaXnY3i6/GuH2FhTgK0v4TN4Y0Wbw"; - }; - file = "Catppuccin-${flavor}.tmTheme"; - }; + # catppuccin = + # { + # src = "${pkgs.catppuccinThemes.bat}"; + # file = "Catppuccin-mocha.tmTheme"; + # }; }; }; diff --git a/config/nix/common/wezterm.nix b/config/nix/common/wezterm.nix index e42aac67..f150d22c 100644 --- a/config/nix/common/wezterm.nix +++ b/config/nix/common/wezterm.nix @@ -12,7 +12,7 @@ }), color_scheme = "Catppuccin Mocha", font_size = 16, - initial_cols = 120, + initial_cols = 200, hide_tab_bar_if_only_one_tab = true, window_background_opacity = 0.8, cursor_blink_rate = 8, diff --git a/config/nix/flake.nix b/config/nix/flake.nix index e8a34f31..34b4cbe1 100644 --- a/config/nix/flake.nix +++ b/config/nix/flake.nix @@ -78,8 +78,16 @@ }; - outputs = { nixpkgs, home-manager, nix-darwin, flake-utils, anyrun, nur - , neovim-nightly-overlay, ... }@inputs: + outputs = + { nixpkgs + , home-manager + , nix-darwin + , flake-utils + , anyrun + , nur + , neovim-nightly-overlay + , ... + }@inputs: let config_devices = [ { @@ -165,7 +173,12 @@ }; }; + catppuccinThemes = final: prev: { + catppuccinThemes = ./themes/catppuccin.nix; + }; + overlays = [ + catppuccinThemes vimPlugins tmuxPlugins inputs.neovim-nightly-overlay.overlay @@ -174,20 +187,24 @@ inputs.nixneovimplugins.overlays.default nur.overlay ]; - in { - nixosConfigurations = let devices = nixos_devices; - in import ./nixos/device.nix { - inherit devices inputs nixpkgs home-manager overlays nur; - }; + in + { + nixosConfigurations = + let devices = nixos_devices; + in import ./nixos/device.nix { + inherit devices inputs nixpkgs home-manager overlays nur; + }; - darwinConfigurations = let devices = darwin_devices; - in import ./darwin/device.nix { - inherit devices inputs nixpkgs home-manager overlays nix-darwin; - }; + darwinConfigurations = + let devices = darwin_devices; + in import ./darwin/device.nix { + inherit devices inputs nixpkgs home-manager overlays nix-darwin; + }; - homeConfigurations = let devices = linux_devices; - in import ./linux/device.nix { - inherit devices inputs nixpkgs home-manager overlays; - }; + homeConfigurations = + let devices = linux_devices; + in import ./linux/device.nix { + inherit devices inputs nixpkgs home-manager overlays; + }; }; } diff --git a/config/nix/linux/default.nix b/config/nix/linux/default.nix index 810100ec..522b2efd 100644 --- a/config/nix/linux/default.nix +++ b/config/nix/linux/default.nix @@ -1,4 +1,4 @@ -{ pkgs, device, nur, ... }: { +{ pkgs, device, nur, inputs, ... }: { imports = [ ../common/firefox.nix ../linux/hyprland.nix @@ -7,6 +7,9 @@ ../linux/ironbar ../linux/foot.nix ]; + + services.kdeconnect.enable = true; + systemd.user.services.spotify-player = { Install = { WantedBy = [ "graphical-session.target" ]; }; Unit = { diff --git a/config/nix/linux/hyprland.nix b/config/nix/linux/hyprland.nix index 48d67aad..0fd46655 100644 --- a/config/nix/linux/hyprland.nix +++ b/config/nix/linux/hyprland.nix @@ -1,7 +1,18 @@ { pkgs, ... }: { wayland.windowManager.hyprland = { enable = true; + settings = { + source = + let + catppuccin = pkgs.fetchFromGitHub { + owner = "catppuccin"; + repo = "hyprland"; + rev = "main"; + sha256 = "sha256-9BhZq9J1LmHfAPBqOr64chiAEzS+YV6zqe9ma95V3no"; + }; + in + "${catppuccin}/themes/mocha.conf"; monitor = [ ",preferred,auto,auto" "DP-1, 2560x1440@170, 0x0, 1, transform, 0" @@ -104,13 +115,11 @@ "QT_QPA_PLATFORM,wayland" ]; exec-once = [ - "${pkgs.swayosd}/bin/swayosd" - "${pkgs.swww}/bin/swww init; swww img ~/.local/share/dotfiles/images/wallpaper.jpg" + "${pkgs.swayosd}/bin/swayosd-server" + # "${pkgs.swww}/bin/swww init; swww img ~/.local/share/dotfiles/images/wallpaper.jpg" "${pkgs.ironbar}/bin/ironbar" "${pkgs.nextcloud-client}/bin/nextcloud --background" "/usr/lib/polkit-kde-authentication-agent-1" - "${pkgs.kdeconnect}/libexec/kdeconnectd" - # "aa-notify -p -s 1 -w 60 -f /var/log/audit/audit.log" ]; "$mainMod" = "SUPER"; @@ -127,16 +136,16 @@ "$mainMod, d, exec, ${pkgs.anyrun}/bin/anyrun" "$mainMod, Space, exec, ${pkgs.anyrun}/bin/anyrun" "$mainMod, p, pseudo, # dwindle" - "$mainMod, v, togglesplit, # dwindle" + "$mainMod, v, togglesplit," "$mainMod, a, exec, swaync-client -t" "$mainMod, Tab, cyclenext" # Audio - ",xf86audioraisevolume, exec, ${pkgs.swayosd}/bin/swayosd --output-volume raise" - ",xf86audiolowervolume, exec, ${pkgs.swayosd}/bin/swayosd --output-volume lower" - ",xf86audiomute, exec, ${pkgs.swayosd}/bin/swayosd --output-volume mute-toggle" - ",xf86audioprev, exec, /home/fs0c131y/.cargo/bin/mctl prev" - ",xf86audionext, exec, /home/fs0c131y/.cargo/bin/mctl next" - ",xf86audioplay, exec, /home/fs0c131y/.cargo/bin/mctl toggle" + ",xf86audioraisevolume, exec, ${pkgs.swayosd}/bin/swayosd-client --output-volume raise" + ",xf86audiolowervolume, exec, ${pkgs.swayosd}/bin/swayosd-client --output-volume lower" + ",xf86audiomute, exec, ${pkgs.swayosd}/bin/swayosd-client --output-volume mute-toggle" + # ",xf86audioprev, exec, /home/fs0c131y/.cargo/bin/mctl prev" + # ",xf86audionext, exec, /home/fs0c131y/.cargo/bin/mctl next" + # ",xf86audioplay, exec, /home/fs0c131y/.cargo/bin/mctl toggle" # Screenshot # "$mainMod,Print, exec, grim" diff --git a/config/nix/linux/ironbar/default.nix b/config/nix/linux/ironbar/default.nix index 04e935a4..39a622e2 100644 --- a/config/nix/linux/ironbar/default.nix +++ b/config/nix/linux/ironbar/default.nix @@ -36,7 +36,7 @@ type = "sys_info"; format = [ " CPU {cpu_percent}% | {temp_c:coretemp-Package-id-0}°C" - " RAM {memory_used}GB/{memory_total}GB ({memory_percent})%" + " RAM {memory_used}GB/{memory_total}GB" ]; interval = { cpu = 1; diff --git a/config/nix/nixos/configuration.nix b/config/nix/nixos/configuration.nix index c58af381..cb8637af 100644 --- a/config/nix/nixos/configuration.nix +++ b/config/nix/nixos/configuration.nix @@ -7,6 +7,7 @@ ./hardware-configuration.nix ]; + security.polkit.enable = true; services.mullvad-vpn.enable = true; services.resolved.enable = true; @@ -15,6 +16,32 @@ pkiBundle = "/etc/secureboot"; }; + services.greetd = + let + tuigreet = "${pkgs.greetd.tuigreet}/bin/tuigreet"; + hyprland-session = "${pkgs.hyprland}/share/wayland-sessions"; + in + { + enable = true; + settings = { + default_session = { + command = "${tuigreet} --time --remember --remember-session --sessions ${hyprland-session}"; + user = "greeter"; + }; + }; + }; + + systemd.services.greetd.serviceConfig = { + Type = "idle"; + StandardInput = "tty"; + StandardOutput = "tty"; + StandardError = "journal"; # Without this errors will spam on screen + # Without these bootlogs will spam on screen + TTYReset = true; + TTYVHangup = true; + TTYVTDisallocate = true; + }; + # services.wireplumber.configPackages = with pkgs; [ bluez ]; # environment.etc = { diff --git a/config/nix/themes/catppuccin.nix b/config/nix/themes/catppuccin.nix new file mode 100644 index 00000000..15ac3072 --- /dev/null +++ b/config/nix/themes/catppuccin.nix @@ -0,0 +1,26 @@ +{ pkgs, flavor, ... }: +let + mkCatppuccin = { owner ? "catppuccin", item, rev ? "main", sha256 ? pkgs.lib.fakeSha256 }: + pkgs.stdenv.mkDerivation { + pname = item; + version = "0.0.1"; + src = pkgs.fetchFromGitHub { + inherit owner rev sha256; + repo = item; + }; + }; +in +{ + + bat = mkCatppuccin { + item = "bat"; + }; + + hyprland = mkCatppuccin { + item = "hyprland"; + }; + + starship = mkCatppuccin { + item = "starship"; + }; +} diff --git a/config/wezterm/wezterm.lua b/config/wezterm/wezterm.lua deleted file mode 100644 index 96150c1f..00000000 --- a/config/wezterm/wezterm.lua +++ /dev/null @@ -1,59 +0,0 @@ -local wezterm = require 'wezterm'; - --- wezterm.font("Hasklug Nerd Font", {weight="Regular", stretch="Normal", style="Normal"}) -- /Users/fs0c131y/Library/Fonts/Hasklug Nerd Font Complete.otf, CoreText -return { - -- -- font = wezterm.font("Hasklug Nerd Font Mono", { weight = "Regular", stretch = "Normal", style = "Normal" }), - -- font = wezterm.font_with_fallback({ - -- "Hasklig", - -- "Symbols Nerd Font Mono" - -- }), - - font_size = 16, - colors = { - -- The default text color - foreground = "#f8f8f2", - -- The default background color - -- background = "#282a36", - -- Overrides the cell background color when the current cell is occupied by the - -- cursor and the cursor style is set to Block - cursor_bg = "#f8f8f2", - -- Overrides the text color when the current cell is occupied by the cursor - cursor_fg = "#000", - -- Specifies the border color of the cursor when the cursor style is set to Block, - -- or the color of the vertical or horizontal bar when the cursor style is set to - -- Bar or Underline. - cursor_border = "#52ad70", - -- the foreground color of selected text - selection_fg = "#ffffff", - -- the background color of selected text - selection_bg = "#ffffff", - -- The color of the scrollbar "thumb"; the portion that represents the current viewport - scrollbar_thumb = "#222222", - -- The color of the split lines between panes - split = "#444444", - ansi = { "#21222c", "#ff5555", "#50fa7b", "#f1fa8c", "#bd93f9", "#ff79c6", "#8be9fd", "#f8f8f2" }, - brights = { "#6272a4", "#ff6e6e", "#69ff94", "#ffffa5", "#d6acff", "#ff92df", "#a4ffff", "#ffffff" }, - -- Arbitrary colors of the palette in the range from 16 to 255 - indexed = { [136] = "#af8700" }, - -- Since: nightly builds only - -- When the IME, a dead key or a leader key are being processed and are effectively - -- holding input pending the result of input composition, change the cursor - -- to this color to give a visual cue about the compose state. - compose_cursor = "orange", - }, - -- color_scheme = "Catppuccin Mocha", - initial_cols = 120, - hide_tab_bar_if_only_one_tab = true, - window_background_opacity = 0.8, - cursor_blink_rate = 8, - default_cursor_style = "BlinkingBlock", - default_prog = { "/opt/homebrew/bin/fish", "-l" }, - window_padding = { - left = 2, - right = 0, - top = 2, - bottom = 0, - }, - window_decorations = "RESIZE", - use_ime = false, -}