From a5f747815ffaa8923e9f1a42e21ca94eb2ccfc99 Mon Sep 17 00:00:00 2001 From: jeirmeister Date: Wed, 30 Oct 2024 21:51:16 -0700 Subject: [PATCH] fix: resolve environment conflicts and configuration issues Python Environment: - Update Python package references to use top-level packages - Move pipenv and poetry from python3Packages to global packages - Fix environment variable conflicts between Python and Rust Rust Configuration: - Remove cargo package to prevent collision with rustup - Keep cargo-related utility packages - Move PATH modifications to shell initialization Shell Configuration: - Move PATH modifications from sessionVariables to zsh.initExtra - Fix PATH order for language tools using shell initialization - Ensure proper loading order for development tools Terminal Configuration: - Replace kitty theme configuration with direct color settings - Implement Dracula color scheme directly in kitty settings - Remove external theme file dependency This commit resolves various dependency conflicts and improves the reliability of language-specific environment configurations while maintaining functionality across all development tools. --- config.json | 3 ++ config.sh | 32 +++++++++++++ .../env/languages/python/default.nix | 1 - .../env/languages/python/pipenv.nix | 2 +- .../env/languages/python/poetry.nix | 2 +- .../env/languages/python/pyenv.nix | 2 +- .../development/env/languages/rust/cargo.nix | 7 ++- .../programs/shell/terminals/kitty.nix | 47 ++++++++++++++++++- 8 files changed, 89 insertions(+), 7 deletions(-) create mode 100644 config.json create mode 100755 config.sh diff --git a/config.json b/config.json new file mode 100644 index 0000000..fa3b134 --- /dev/null +++ b/config.json @@ -0,0 +1,3 @@ +{ + "users/jeirmeister/programs/shell/terminals/kitty.nix": "{ config, pkgs, ... }:\n\n{\n programs.kitty = {\n enable = true;\n settings = {\n font_family = \"JetBrains Mono\";\n font_size = 12;\n window_padding_width = 4;\n background_opacity = \"0.95\";\n hide_window_decorations = \"yes\";\n tab_bar_style = \"powerline\";\n \n # Dracula theme colors\n foreground = \"#F8F8F2\";\n background = \"#282A36\";\n selection_foreground = \"#ffffff\";\n selection_background = \"#44475a\";\n url_color = \"#8be9fd\";\n cursor = \"#f8f8f2\";\n\n # black\n color0 = \"#21222c\";\n color8 = \"#6272a4\";\n\n # red\n color1 = \"#ff5555\";\n color9 = \"#ff6e6e\";\n\n # green\n color2 = \"#50fa7b\";\n color10 = \"#69ff94\";\n\n # yellow\n color3 = \"#f1fa8c\";\n color11 = \"#ffffa5\";\n\n # blue\n color4 = \"#bd93f9\";\n color12 = \"#d6acff\";\n\n # magenta\n color5 = \"#ff79c6\";\n color13 = \"#ff92df\";\n\n # cyan\n color6 = \"#8be9fd\";\n color14 = \"#a4ffff\";\n\n # white\n color7 = \"#f8f8f2\";\n color15 = \"#ffffff\";\n\n # tab bar\n active_tab_foreground = \"#282a36\";\n active_tab_background = \"#f8f8f2\";\n inactive_tab_foreground = \"#282a36\";\n inactive_tab_background = \"#6272a4\";\n };\n };\n}" +} \ No newline at end of file diff --git a/config.sh b/config.sh new file mode 100755 index 0000000..5a9f5e4 --- /dev/null +++ b/config.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +# README # ------ +# Configure the config.json file in this same directory for an AI chatbot to +# Assist in making direct changes to files. +set -euo pipefail + +# Make sure jq is available +if ! command -v jq &> /dev/null; then + echo "Error: jq is required but not installed" + exit 1 +fi + +# Make sure config.json exists +if [ ! -f "config.json" ]; then + echo "Error: config.json not found in current directory" + exit 1 +fi + +echo "Creating directories and files..." + +# Process each key in the JSON configuration +for file in $(jq -r 'keys[]' config.json); do + # Create directory if it doesn't exist + dir=$(dirname "$file") + mkdir -p "$dir" + + # Write content to file + jq -r --arg file "$file" '.[$file]' config.json > "$file" + echo "Created: $file" +done + +echo "Configuration files have been created successfully!" diff --git a/users/jeirmeister/programs/development/env/languages/python/default.nix b/users/jeirmeister/programs/development/env/languages/python/default.nix index 46f1710..77dc907 100644 --- a/users/jeirmeister/programs/development/env/languages/python/default.nix +++ b/users/jeirmeister/programs/development/env/languages/python/default.nix @@ -20,7 +20,6 @@ PYTHONDONTWRITEBYTECODE = 1; PYTHONIOENCODING = "UTF-8"; PYTHONUSERBASE = "$HOME/.local/python"; - PATH = "$PYTHONUSERBASE/bin:$PATH"; }; # Create Python user directory diff --git a/users/jeirmeister/programs/development/env/languages/python/pipenv.nix b/users/jeirmeister/programs/development/env/languages/python/pipenv.nix index de39091..2845fd2 100644 --- a/users/jeirmeister/programs/development/env/languages/python/pipenv.nix +++ b/users/jeirmeister/programs/development/env/languages/python/pipenv.nix @@ -2,7 +2,7 @@ { home.packages = with pkgs; [ - python311Packages.pipenv + pipenv ]; home.sessionVariables = { diff --git a/users/jeirmeister/programs/development/env/languages/python/poetry.nix b/users/jeirmeister/programs/development/env/languages/python/poetry.nix index da2e626..d5771ac 100644 --- a/users/jeirmeister/programs/development/env/languages/python/poetry.nix +++ b/users/jeirmeister/programs/development/env/languages/python/poetry.nix @@ -2,7 +2,7 @@ { home.packages = with pkgs; [ - python311Packages.poetry + poetry ]; home.sessionVariables = { diff --git a/users/jeirmeister/programs/development/env/languages/python/pyenv.nix b/users/jeirmeister/programs/development/env/languages/python/pyenv.nix index b096b91..8fbeb9c 100644 --- a/users/jeirmeister/programs/development/env/languages/python/pyenv.nix +++ b/users/jeirmeister/programs/development/env/languages/python/pyenv.nix @@ -7,7 +7,6 @@ home.sessionVariables = { PYENV_ROOT = "$HOME/.pyenv"; - PATH = "$PYENV_ROOT/bin:$PATH"; PYENV_SHELL = "zsh"; PYENV_VIRTUALENV_INIT = "1"; }; @@ -15,6 +14,7 @@ home.file.".pyenv/version".text = "system"; programs.zsh.initExtra = '' + export PATH="$PYENV_ROOT/bin:$PATH" eval "$(pyenv init --path)" eval "$(pyenv virtualenv-init -)" ''; diff --git a/users/jeirmeister/programs/development/env/languages/rust/cargo.nix b/users/jeirmeister/programs/development/env/languages/rust/cargo.nix index 662eed1..8e3e0ca 100644 --- a/users/jeirmeister/programs/development/env/languages/rust/cargo.nix +++ b/users/jeirmeister/programs/development/env/languages/rust/cargo.nix @@ -2,7 +2,7 @@ { home.packages = with pkgs; [ - cargo + # cargo is provided by rustup cargo-edit cargo-watch cargo-audit @@ -11,9 +11,12 @@ home.sessionVariables = { CARGO_HOME = "$HOME/.cargo"; - PATH = "$CARGO_HOME/bin:$PATH"; }; + programs.zsh.initExtra = '' + export PATH="$CARGO_HOME/bin:$PATH" + ''; + home.file.".cargo/config.toml".text = '' [build] target-dir = "target" diff --git a/users/jeirmeister/programs/shell/terminals/kitty.nix b/users/jeirmeister/programs/shell/terminals/kitty.nix index bcbeab9..99eaa5e 100644 --- a/users/jeirmeister/programs/shell/terminals/kitty.nix +++ b/users/jeirmeister/programs/shell/terminals/kitty.nix @@ -10,7 +10,52 @@ background_opacity = "0.95"; hide_window_decorations = "yes"; tab_bar_style = "powerline"; + + # Dracula theme colors + foreground = "#F8F8F2"; + background = "#282A36"; + selection_foreground = "#ffffff"; + selection_background = "#44475a"; + url_color = "#8be9fd"; + cursor = "#f8f8f2"; + + # black + color0 = "#21222c"; + color8 = "#6272a4"; + + # red + color1 = "#ff5555"; + color9 = "#ff6e6e"; + + # green + color2 = "#50fa7b"; + color10 = "#69ff94"; + + # yellow + color3 = "#f1fa8c"; + color11 = "#ffffa5"; + + # blue + color4 = "#bd93f9"; + color12 = "#d6acff"; + + # magenta + color5 = "#ff79c6"; + color13 = "#ff92df"; + + # cyan + color6 = "#8be9fd"; + color14 = "#a4ffff"; + + # white + color7 = "#f8f8f2"; + color15 = "#ffffff"; + + # tab bar + active_tab_foreground = "#282a36"; + active_tab_background = "#f8f8f2"; + inactive_tab_foreground = "#282a36"; + inactive_tab_background = "#6272a4"; }; - theme = "Dracula"; }; }