diff --git a/.bashrc b/.bashrc index 0485dd3..6e59a73 100644 --- a/.bashrc +++ b/.bashrc @@ -112,9 +112,9 @@ alias ls="exa --icons" alias ll="exa -lah --icons" alias q="exit" alias c="clear" -alias ci="init_conda" -alias ca="conda activate" -alias cii="export INIT_CONDA=true && init_conda" +alias ci="init_mamba" +alias ca="micromamba activate" +alias cii="export INIT_MAMBA=true && init_mamba" # Aliases:1 ends here # [[file:Console.org::*Aliases][Aliases:2]] @@ -124,26 +124,27 @@ if [[ ! -z "$SIMPLE" ]]; then fi # Aliases:2 ends here -# [[file:Console.org::*Anaconda][Anaconda:1]] -init_conda () { - __conda_setup="$('/home/pavel/.guix-extra-profiles/dev/dev/bin/conda' 'shell.bash' 'hook' 2> /dev/null)" +# [[file:Console.org::*Micromamba][Micromamba:1]] +init_mamba () { + export MAMBA_EXE="/gnu/store/w0rrglxs2247nr4wawrh5dylisjra1q4-micromamba-bin-1.4.4-0/bin/micromamba"; + export MAMBA_ROOT_PREFIX="/home/pavel/micromamba"; + __mamba_setup="$("$MAMBA_EXE" shell hook --shell bash --prefix "$MAMBA_ROOT_PREFIX" 2> /dev/null)" if [ $? -eq 0 ]; then - eval "$__conda_setup" + eval "$__mamba_setup" else - if [ -f "/home/pavel/.guix-extra-profiles/dev/dev/etc/profile.d/conda.sh" ]; then - . "/home/pavel/.guix-extra-profiles/dev/dev/etc/profile.d/conda.sh" + if [ -f "/home/pavel/micromamba/etc/profile.d/micromamba.sh" ]; then + . "/home/pavel/micromamba/etc/profile.d/micromamba.sh" else - # export PATH="/home/pavel/Programs/miniconda3/bin:$PATH" - echo "what" + export PATH="/home/pavel/micromamba/bin:$PATH" # extra space after export prevents interference from conda init fi fi - unset __conda_setup + unset __mamba_setup } -if [[ ! -z "$INIT_CONDA" ]]; then - init_conda +if [[ ! -z "$INIT_MAMBA" ]]; then + init_mamba fi -# Anaconda:1 ends here +# Micromamba:1 ends here # [[file:Console.org::*Starship][Starship:1]] if [[ -z "$SIMPLE" && "$TERM" != "dumb" ]]; then diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml index 9d32e78..3cf4c13 100644 --- a/.config/alacritty/alacritty.yml +++ b/.config/alacritty/alacritty.yml @@ -34,13 +34,12 @@ colors: Cyan: '#a3f7ff' White: '#ffffff' -background_opacity: 0.80 - window: padding: x: 0 y: 0 dynamic_padding: true + opacity: 0.80 key_bindings: - { key: Paste, action: Paste } diff --git a/.config/fish/config.fish b/.config/fish/config.fish index aac4566..6487ffd 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -13,10 +13,9 @@ alias ls="exa --icons" alias ll="exa -lah --icons" alias q="exit" alias c="clear" -alias ci="init_conda" -alias ca="conda activate" -alias cii="export INIT_CONDA=true && init_conda" -alias cad="conda activate (basename (pwd))" +alias ci="init_mamba" +alias ca="micromamba activate" +alias cii="export INIT_MAMBA=true && init_mamba" # Fish:2 ends here # [[file:../../Console.org::*Fish][Fish:3]] @@ -29,21 +28,23 @@ end set fish_greeting # Fish:4 ends here -# [[file:../../Console.org::*Anaconda][Anaconda:1]] -function init_conda - eval /home/pavel/.guix-extra-profiles/dev/dev/bin/conda "shell.fish" "hook" $argv | source +# [[file:../../Console.org::*Micromamba][Micromamba:1]] +function init_mamba + set -gx MAMBA_EXE "/gnu/store/w0rrglxs2247nr4wawrh5dylisjra1q4-micromamba-bin-1.4.4-0/bin/micromamba" + set -gx MAMBA_ROOT_PREFIX "/home/pavel/micromamba" + $MAMBA_EXE shell hook --shell fish --prefix $MAMBA_ROOT_PREFIX | source end -if test -n "$INIT_CONDA"; - init_conda +if test -n "$INIT_MAMBA"; + init_mamba end -# Anaconda:1 ends here +# Micromamba:1 ends here -# [[file:../../Console.org::*Anaconda][Anaconda:2]] -if test -n "$EMACS_CONDA_ENV"; - conda activate $EMACS_CONDA_ENV -end -# Anaconda:2 ends here +# [[file:../../Console.org::*Micromamba][Micromamba:2]] +# if test -n "$EMACS_CONDA_ENV"; + # conda activate $EMACS_CONDA_ENV +# end +# Micromamba:2 ends here # [[file:../../Console.org::*Colors][Colors:1]] set fish_color_command cyan diff --git a/.config/guix/channels.scm b/.config/guix/channels.scm index 818e92d..bf4a6c0 100644 --- a/.config/guix/channels.scm +++ b/.config/guix/channels.scm @@ -2,7 +2,7 @@ (cons* (channel (name 'channel-q) - (url "file:///home/pavel/Code/channel-q")) + (url "file:///home/pavel/_channel-q")) (channel (name 'flat) (url "https://github.com/flatwhatson/guix-channel.git") diff --git a/.config/guix/manifests/console.scm b/.config/guix/manifests/console.scm index eb089a5..3dad623 100644 --- a/.config/guix/manifests/console.scm +++ b/.config/guix/manifests/console.scm @@ -1,7 +1,8 @@ (specifications->manifest '( + "ncdu" "megacmd" - "jless" + "jless-bin" "direnv" "glibc-locales" "git-lfs" diff --git a/.config/guix/manifests/dev.scm b/.config/guix/manifests/dev.scm index 18515f4..be07986 100644 --- a/.config/guix/manifests/dev.scm +++ b/.config/guix/manifests/dev.scm @@ -21,4 +21,4 @@ "postgresql" "docker-compose" "pandoc" - "conda")) + "micromamba-bin")) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 680706f..346299a 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -82,24 +82,11 @@ (lambda (data) (message "%f Gb" (/ (float data) 1024 1024))))) -(use-package conda - :straight t - :if (executable-find "conda") +(use-package micromamba + :straight (:local-repo "~/10-19 Code/12 My Emacs Packages/12.12 micromamba.el") + :if (executable-find "micromamba") :config - (setq conda-anaconda-home (string-replace "/bin/conda" "" (executable-find "conda"))) - (setq conda-env-home-directory (expand-file-name "~/.conda/")) - (setq conda-env-subdirectory "envs") - - (advice-add 'conda-env-activate :after - (lambda (&rest _) - (setenv "EMACS_CONDA_ENV" conda-env-current-name) - (setenv "INIT_CONDA" "true"))) - (advice-add 'conda-env-deactivate :after - (lambda (&rest _) - (setenv "EMACS_CONDA_ENV" nil) - (setenv "INIT_CONDA" nil))) - (unless (getenv "CONDA_DEFAULT_ENV") - (conda-env-activate "general"))) + (micromamba-activate "general")) (setq custom-file (concat user-emacs-directory "custom.el")) (load custom-file 'noerror) @@ -6019,7 +6006,7 @@ base toot." (defun my/ement-room-send-reaction (key position) (interactive (list - (completing-read "Add reaction: " telega-emoji-reaction-list) + (completing-read "Add reaction: " (append telega-emoji-reaction-list '("👋"))) (point))) (ement-room-send-reaction key position)) diff --git a/Console.org b/Console.org index 2cede4f..d2d69b0 100644 --- a/Console.org +++ b/Console.org @@ -374,9 +374,9 @@ alias ls="exa --icons" alias ll="exa -lah --icons" alias q="exit" alias c="clear" -alias ci="init_conda" -alias ca="conda activate" -alias cii="export INIT_CONDA=true && init_conda" +alias ci="init_mamba" +alias ca="micromamba activate" +alias cii="export INIT_MAMBA=true && init_mamba" #+end_src #+begin_src bash @@ -385,32 +385,36 @@ if [[ ! -z "$SIMPLE" ]]; then alias ll="ls -lah" fi #+end_src -*** Anaconda +*** Micromamba +I've moved from conda to [[https://github.com/mamba-org/mamba][micromamba]] because it's faster. + #+begin_quote -managed by 'conda init' !!! +managed by 'mamba init' !!! #+end_quote Yeah, tell this to yourself #+begin_src bash -init_conda () { - __conda_setup="$('/home/pavel/.guix-extra-profiles/dev/dev/bin/conda' 'shell.bash' 'hook' 2> /dev/null)" +init_mamba () { + export MAMBA_EXE="/gnu/store/w0rrglxs2247nr4wawrh5dylisjra1q4-micromamba-bin-1.4.4-0/bin/micromamba"; + export MAMBA_ROOT_PREFIX="/home/pavel/micromamba"; + __mamba_setup="$("$MAMBA_EXE" shell hook --shell bash --prefix "$MAMBA_ROOT_PREFIX" 2> /dev/null)" if [ $? -eq 0 ]; then - eval "$__conda_setup" + eval "$__mamba_setup" else - if [ -f "/home/pavel/.guix-extra-profiles/dev/dev/etc/profile.d/conda.sh" ]; then - . "/home/pavel/.guix-extra-profiles/dev/dev/etc/profile.d/conda.sh" + if [ -f "/home/pavel/micromamba/etc/profile.d/micromamba.sh" ]; then + . "/home/pavel/micromamba/etc/profile.d/micromamba.sh" else - # export PATH="/home/pavel/Programs/miniconda3/bin:$PATH" - echo "what" + export PATH="/home/pavel/micromamba/bin:$PATH" # extra space after export prevents interference from conda init fi fi - unset __conda_setup + unset __mamba_setup } -if [[ ! -z "$INIT_CONDA" ]]; then - init_conda +if [[ ! -z "$INIT_MAMBA" ]]; then + init_mamba fi #+end_src + *** Starship #+begin_src bash if [[ -z "$SIMPLE" && "$TERM" != "dumb" ]]; then @@ -450,7 +454,6 @@ Enable vi keybindings & aliases. The alias syntax is the same as in bash, so it' fish_vi_key_bindings <> -alias cad="conda activate (basename (pwd))" #+end_src @@ -469,23 +472,25 @@ Suppress fish greeting #+begin_src fish set fish_greeting #+end_src -** Anaconda -First, a function to initialize anaconda. +** Micromamba +First, a function to initialize micromamba. #+begin_src fish -function init_conda - eval /home/pavel/.guix-extra-profiles/dev/dev/bin/conda "shell.fish" "hook" $argv | source +function init_mamba + set -gx MAMBA_EXE "/gnu/store/w0rrglxs2247nr4wawrh5dylisjra1q4-micromamba-bin-1.4.4-0/bin/micromamba" + set -gx MAMBA_ROOT_PREFIX "/home/pavel/micromamba" + $MAMBA_EXE shell hook --shell fish --prefix $MAMBA_ROOT_PREFIX | source end -if test -n "$INIT_CONDA"; - init_conda +if test -n "$INIT_MAMBA"; + init_mamba end #+end_src Then, check if launched from Emacs with environment activated. #+begin_src fish -if test -n "$EMACS_CONDA_ENV"; - conda activate $EMACS_CONDA_ENV -end +# if test -n "$EMACS_CONDA_ENV"; + # conda activate $EMACS_CONDA_ENV +# end #+end_src ** Colors Fish seems to have hardcoded colorcodes in some color settings. I set these to base16 colors, so they would match Xresources. @@ -776,13 +781,12 @@ colors: Cyan: '<>' White: '<>' -background_opacity: 0.80 - window: padding: x: 0 y: 0 dynamic_padding: true + opacity: 0.80 key_bindings: - { key: Paste, action: Paste } @@ -831,8 +835,9 @@ key_bindings: | git-lfs | | | glibc-locales | | | direnv | | -| jless | JSON viewer | +| jless-bin | JSON viewer | | megacmd | mega.nz client | +| ncdu | disk usage analyzer | ** ripgrep config Occasionally I can't exclude certain files from ripgrep via the VCS settings, so here is a simple config to ignore certain files globally. diff --git a/Desktop.org b/Desktop.org index 2af8011..2950a7d 100644 --- a/Desktop.org +++ b/Desktop.org @@ -3355,7 +3355,7 @@ This section generates manifests for various desktop software that I'm using. ** Dev | Category | Guix dependency | Disabled | |----------+-------------------+----------| -| dev | conda | | +| dev | micromamba-bin | | | dev | pandoc | | | dev | docker-compose | | | dev | postgresql | | diff --git a/Emacs.org b/Emacs.org index 7c24eca..2517be1 100644 --- a/Emacs.org +++ b/Emacs.org @@ -217,7 +217,7 @@ I have some concerns that =ps -o rss= may be unrepresentative because of [[https (lambda (data) (message "%f Gb" (/ (float data) 1024 1024))))) #+end_src -** Anaconda +** OFF Anaconda [[https://www.anaconda.com/][Anaconda]] is a free package and environment manager. I currently use it to manage multiple versions of Python and Node.js. Take a look at [[file:Guix.org::*conda][the corresponding entry]] in the Guix config for details about using it on Guix. The following code uses the =conda= package to activate the base environment on startup if Emacs is launched outside the environment. @@ -228,12 +228,13 @@ References: - [[https://docs.anaconda.com/][Anaconda docs]] - [[https://github.com/necaris/conda.el][conda.el repo]] -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle no (use-package conda :straight t :if (executable-find "conda") :config (setq conda-anaconda-home (string-replace "/bin/conda" "" (executable-find "conda"))) + (setq conda--executable-path (executable-find "micromamba")) (setq conda-env-home-directory (expand-file-name "~/.conda/")) (setq conda-env-subdirectory "envs") @@ -248,6 +249,18 @@ References: (unless (getenv "CONDA_DEFAULT_ENV") (conda-env-activate "general"))) #+end_src +** Micromamba +[[https://github.com/mamba-org/mamba][mamba]] is a faster alternative to [[https://www.anaconda.com/][Anaconda]], a package and environment manager. =micromamba= is a tiny version that provides a subset of mamba commands. + +=micromamba.el= is my package to interact with the latter. + +#+begin_src emacs-lisp +(use-package micromamba + :straight (:local-repo "~/10-19 Code/12 My Emacs Packages/12.12 micromamba.el") + :if (executable-find "micromamba") + :config + (micromamba-activate "general")) +#+end_src ** Config files *** Custom file location By default, =custom= writes stuff to =init.el=, which is somewhat annoying. The following makes it write to a separate file =custom.el= @@ -1225,7 +1238,7 @@ Setting up quick access to various completions. "" '(:which-key "various completions")' ;; "b" 'counsel-switch-buffer "b" 'persp-ivy-switch-buffer - "e" 'conda-env-activate + "e" 'micromamba-activate "f" 'project-find-file "c" 'counsel-yank-pop "a" 'counsel-rg diff --git a/Guix.org b/Guix.org index 6cb0ea4..f49246f 100644 --- a/Guix.org +++ b/Guix.org @@ -127,7 +127,7 @@ References: (cons* (channel (name 'channel-q) - (url "file:///home/pavel/Code/channel-q")) + (url "file:///home/pavel/_channel-q")) (channel (name 'flat) (url "https://github.com/flatwhatson/guix-channel.git")