[feat] Fix the issue with sourcing the Cattppucin themes

This commit is contained in:
uttarayan21
2024-03-04 04:30:13 +05:30
parent 1d8361356e
commit 22ffff0509
4 changed files with 35 additions and 26 deletions

View File

@@ -1,7 +1,7 @@
{ config, pkgs, lib, device, ... }: { config, pkgs, lib, device, ... }:
let let
start-tmux = (import ../scripts/start-tmux.nix) pkgs;
# https://mipmip.github.io/home-manager-option-search/ # https://mipmip.github.io/home-manager-option-search/
start-tmux = (import ../scripts/start-tmux.nix) pkgs;
lazy = false; lazy = false;
in in
{ {
@@ -114,6 +114,7 @@ in
vi = "nvim"; vi = "nvim";
nv = "nvim"; nv = "nvim";
g = "git"; g = "git";
yy = "yazi";
cd = "z"; cd = "z";
ls = "exa"; ls = "exa";
t = "${start-tmux}"; t = "${start-tmux}";
@@ -127,13 +128,16 @@ in
''; '';
interactiveShellInit = '' interactiveShellInit = ''
${pkgs.spotify-player}/bin/spotify_player generate fish | source ${pkgs.spotify-player}/bin/spotify_player generate fish | source
${pkgs.macchina.outPath}/bin/macchina ${pkgs.macchina}/bin/macchina
''; '';
}; };
nushell = { nushell = {
enable = true; enable = true;
shellAliases = { "cd" = "z"; }; shellAliases = {
cd = "z";
yy = "yazi";
};
package = pkgs.nushellFull; package = pkgs.nushellFull;
configFile.text = '' configFile.text = ''
$env.config = { $env.config = {
@@ -156,13 +160,8 @@ in
# Other config here # Other config here
format = "$all"; # Remove this line to disable the default prompt format format = "$all"; # Remove this line to disable the default prompt format
palette = "catppuccin_${flavour}"; palette = "catppuccin_${flavour}";
} // builtins.fromTOML (builtins.readFile (pkgs.fetchFromGitHub } // builtins.fromTOML (builtins.readFile (pkgs.catppuccinThemes.starship
{ + /palettes/${flavour}.toml));
owner = "catppuccin";
repo = "starship";
rev = "main"; # Replace with the latest commit hash
sha256 = "sha256-nsRuxQFKbQkyEI4TXgvAjcroVdG+heKX5Pauq/4Ota0";
} + /palettes/${flavour}.toml));
}; };
eza = { eza = {
enable = true; enable = true;
@@ -190,11 +189,11 @@ in
enable = true; enable = true;
config = { theme = "catppuccin"; }; config = { theme = "catppuccin"; };
themes = { themes = {
# catppuccin = catppuccin =
# { {
# src = "${pkgs.catppuccinThemes.bat}"; src = "${pkgs.catppuccinThemes.bat}/themes";
# file = "Catppuccin-mocha.tmTheme"; file = "Catppuccin Mocha.tmTheme";
# }; };
}; };
}; };

View File

@@ -174,7 +174,9 @@
}; };
catppuccinThemes = final: prev: { catppuccinThemes = final: prev: {
catppuccinThemes = ./themes/catppuccin.nix; catppuccinThemes = import ./themes/catppuccin.nix {
pkgs = final.pkgs;
};
}; };
overlays = [ overlays = [

View File

@@ -4,15 +4,15 @@
settings = { settings = {
source = source =
let # let
catppuccin = pkgs.fetchFromGitHub { # catppuccin = pkgs.fetchFromGitHub {
owner = "catppuccin"; # owner = "catppuccin";
repo = "hyprland"; # repo = "hyprland";
rev = "main"; # rev = "main";
sha256 = "sha256-9BhZq9J1LmHfAPBqOr64chiAEzS+YV6zqe9ma95V3no"; # sha256 = "sha256-9BhZq9J1LmHfAPBqOr64chiAEzS+YV6zqe9ma95V3no";
}; # };
in # in
"${catppuccin}/themes/mocha.conf"; "${pkgs.catppuccinThemes.hyprland}/themes/mocha.conf";
monitor = [ monitor = [
",preferred,auto,auto" ",preferred,auto,auto"
"DP-1, 2560x1440@170, 0x0, 1, transform, 0" "DP-1, 2560x1440@170, 0x0, 1, transform, 0"

View File

@@ -1,4 +1,4 @@
{ pkgs, flavor, ... }: { pkgs, ... }:
let let
mkCatppuccin = { owner ? "catppuccin", item, rev ? "main", sha256 ? pkgs.lib.fakeSha256 }: mkCatppuccin = { owner ? "catppuccin", item, rev ? "main", sha256 ? pkgs.lib.fakeSha256 }:
pkgs.stdenv.mkDerivation { pkgs.stdenv.mkDerivation {
@@ -8,19 +8,27 @@ let
inherit owner rev sha256; inherit owner rev sha256;
repo = item; repo = item;
}; };
buildPhase = ''
echo "Building Cattppucin for ${item}..."
mkdir -p $out
cp -r ./* $out/
'';
}; };
in in
{ {
bat = mkCatppuccin { bat = mkCatppuccin {
item = "bat"; item = "bat";
sha256 = "sha256-PLbTLj0qhsDj+xm+OML/AQsfRQVPXLYQNEPllgKcEx4";
}; };
hyprland = mkCatppuccin { hyprland = mkCatppuccin {
item = "hyprland"; item = "hyprland";
sha256 = "sha256-9BhZq9J1LmHfAPBqOr64chiAEzS+YV6zqe9ma95V3no";
}; };
starship = mkCatppuccin { starship = mkCatppuccin {
item = "starship"; item = "starship";
sha256 = "sha256-nsRuxQFKbQkyEI4TXgvAjcroVdG+heKX5Pauq/4Ota0";
}; };
} }