From 22ffff050934e95e9801b9248bef9e9f314dcfa7 Mon Sep 17 00:00:00 2001 From: uttarayan21 Date: Mon, 4 Mar 2024 04:30:13 +0530 Subject: [PATCH] [feat] Fix the issue with sourcing the Cattppucin themes --- config/nix/common/home.nix | 29 ++++++++++++++--------------- config/nix/flake.nix | 4 +++- config/nix/linux/hyprland.nix | 18 +++++++++--------- config/nix/themes/catppuccin.nix | 10 +++++++++- 4 files changed, 35 insertions(+), 26 deletions(-) diff --git a/config/nix/common/home.nix b/config/nix/common/home.nix index 1506422c..2cecc974 100644 --- a/config/nix/common/home.nix +++ b/config/nix/common/home.nix @@ -1,7 +1,7 @@ { config, pkgs, lib, device, ... }: let - start-tmux = (import ../scripts/start-tmux.nix) pkgs; # https://mipmip.github.io/home-manager-option-search/ + start-tmux = (import ../scripts/start-tmux.nix) pkgs; lazy = false; in { @@ -114,6 +114,7 @@ in vi = "nvim"; nv = "nvim"; g = "git"; + yy = "yazi"; cd = "z"; ls = "exa"; t = "${start-tmux}"; @@ -127,13 +128,16 @@ in ''; interactiveShellInit = '' ${pkgs.spotify-player}/bin/spotify_player generate fish | source - ${pkgs.macchina.outPath}/bin/macchina + ${pkgs.macchina}/bin/macchina ''; }; nushell = { enable = true; - shellAliases = { "cd" = "z"; }; + shellAliases = { + cd = "z"; + yy = "yazi"; + }; package = pkgs.nushellFull; configFile.text = '' $env.config = { @@ -156,13 +160,8 @@ in # Other config here format = "$all"; # Remove this line to disable the default prompt format palette = "catppuccin_${flavour}"; - } // builtins.fromTOML (builtins.readFile (pkgs.fetchFromGitHub - { - owner = "catppuccin"; - repo = "starship"; - rev = "main"; # Replace with the latest commit hash - sha256 = "sha256-nsRuxQFKbQkyEI4TXgvAjcroVdG+heKX5Pauq/4Ota0"; - } + /palettes/${flavour}.toml)); + } // builtins.fromTOML (builtins.readFile (pkgs.catppuccinThemes.starship + + /palettes/${flavour}.toml)); }; eza = { enable = true; @@ -190,11 +189,11 @@ in enable = true; config = { theme = "catppuccin"; }; themes = { - # catppuccin = - # { - # src = "${pkgs.catppuccinThemes.bat}"; - # file = "Catppuccin-mocha.tmTheme"; - # }; + catppuccin = + { + src = "${pkgs.catppuccinThemes.bat}/themes"; + file = "Catppuccin Mocha.tmTheme"; + }; }; }; diff --git a/config/nix/flake.nix b/config/nix/flake.nix index 34b4cbe1..e591071b 100644 --- a/config/nix/flake.nix +++ b/config/nix/flake.nix @@ -174,7 +174,9 @@ }; catppuccinThemes = final: prev: { - catppuccinThemes = ./themes/catppuccin.nix; + catppuccinThemes = import ./themes/catppuccin.nix { + pkgs = final.pkgs; + }; }; overlays = [ diff --git a/config/nix/linux/hyprland.nix b/config/nix/linux/hyprland.nix index 0fd46655..fccadbf2 100644 --- a/config/nix/linux/hyprland.nix +++ b/config/nix/linux/hyprland.nix @@ -4,15 +4,15 @@ settings = { source = - let - catppuccin = pkgs.fetchFromGitHub { - owner = "catppuccin"; - repo = "hyprland"; - rev = "main"; - sha256 = "sha256-9BhZq9J1LmHfAPBqOr64chiAEzS+YV6zqe9ma95V3no"; - }; - in - "${catppuccin}/themes/mocha.conf"; + # let + # catppuccin = pkgs.fetchFromGitHub { + # owner = "catppuccin"; + # repo = "hyprland"; + # rev = "main"; + # sha256 = "sha256-9BhZq9J1LmHfAPBqOr64chiAEzS+YV6zqe9ma95V3no"; + # }; + # in + "${pkgs.catppuccinThemes.hyprland}/themes/mocha.conf"; monitor = [ ",preferred,auto,auto" "DP-1, 2560x1440@170, 0x0, 1, transform, 0" diff --git a/config/nix/themes/catppuccin.nix b/config/nix/themes/catppuccin.nix index 15ac3072..f7bc6f21 100644 --- a/config/nix/themes/catppuccin.nix +++ b/config/nix/themes/catppuccin.nix @@ -1,4 +1,4 @@ -{ pkgs, flavor, ... }: +{ pkgs, ... }: let mkCatppuccin = { owner ? "catppuccin", item, rev ? "main", sha256 ? pkgs.lib.fakeSha256 }: pkgs.stdenv.mkDerivation { @@ -8,19 +8,27 @@ let inherit owner rev sha256; repo = item; }; + buildPhase = '' + echo "Building Cattppucin for ${item}..." + mkdir -p $out + cp -r ./* $out/ + ''; }; in { bat = mkCatppuccin { item = "bat"; + sha256 = "sha256-PLbTLj0qhsDj+xm+OML/AQsfRQVPXLYQNEPllgKcEx4"; }; hyprland = mkCatppuccin { item = "hyprland"; + sha256 = "sha256-9BhZq9J1LmHfAPBqOr64chiAEzS+YV6zqe9ma95V3no"; }; starship = mkCatppuccin { item = "starship"; + sha256 = "sha256-nsRuxQFKbQkyEI4TXgvAjcroVdG+heKX5Pauq/4Ota0"; }; }