This commit is contained in:
Pavel Korytov 2021-10-01 18:59:00 +03:00
parent e7fb0b8cd9
commit de70f18f5f
20 changed files with 328 additions and 176 deletions

View file

@ -529,6 +529,17 @@ bind -M insert \eb backward-word
```
### Functions {#functions}
A small function to open the file with `$EDITOR`.
```fish
function e
eval $EDITOR $argv
end
```
## Nushell {#nushell}
| Guix dependency |

View file

@ -17,7 +17,6 @@ draft = false
# export BROWSER=/usr/bin/firefox
export QT_QPA_PLATFORMTHEME="qt5ct"
export QT_AUTO_SCREEN_SCALE_FACTOR=0
export TZ="Asia/Yekaterinburg"
# export GTK2_RC_FILES="$HOME/.gtkrc-2.0"
```

View file

@ -68,6 +68,7 @@ Parts prefixed with (OFF) are not used, but kept for historic purposes. For some
- [Scripts](#scripts)
- [Buku bookmarks](#buku-bookmarks)
- [Man pages](#man-pages)
- [pass](#pass)
- [Flameshot](#flameshot)
- [dunst](#dunst)
- [keynav](#keynav)
@ -576,7 +577,7 @@ bindsym $mod+Shift+g mode "outer gaps"
A more or less standard set of keybindings to move & resize floating windows.
Just be careful to always make a way to return from these new modes, otherwise, you'd end up in a rather precarious position.
Just be careful to always make a way to return from these new modes, otherwise you'd end up in a rather precarious situation.
```vim
# resize window (you can also use the mouse for that)
@ -665,6 +666,7 @@ Keybindings to launch [rofi](https://github.com/davatorium/rofi). For more detai
```vim
bindsym $mod+d exec "rofi -modi 'drun,run' -show drun"
bindsym $mod+b exec --no-startup-id rofi-buku-mine
bindsym $mod+minus exec rofi-pass; mode default
bindsym $mod+apostrophe mode "rofi"
@ -672,7 +674,7 @@ mode "rofi" {
bindsym d exec "rofi -modi 'drun,run' -show drun"
bindsym m exec rofi-man; mode default
bindsym b exec rofi-buku-mine; mode default
bindsym k exec rofi-keepassxc -d ~/MEGAsync/Passwords.kdbx; mode default
bindsym k exec rofi-pass; mode default
bindsym Escape mode "default"
}
```
@ -936,7 +938,7 @@ declare -A BLOCKS=(
)
# Geolocation for some modules
export LOC="TMN"
export LOC="SPB"
export IPSTACK_API_KEY=$(pass show My_Online/APIs/ipstack | head -n 1)
@ -1713,6 +1715,23 @@ fi
```
#### pass {#pass}
| Guix dependency |
|-----------------|
| rofi-pass |
| xset |
A nice [pass frontend for Rofi](https://github.com/carnager/rofi-pass), which is even packaged for Guix.
```bash
USERNAME_field='username'
EDITOR=vim
default_autotype='username :tab pass'
clip=both
```
## Flameshot {#flameshot}
| Guix dependency |
@ -1813,7 +1832,7 @@ References:
# Show how many messages are currently hidden (because of geometry).
indicate_hidden = yes
# Shrink window if it's smaller than the width. Will be ignored if
# Shrink window if its smaller than the width. Will be ignored if
# width is 0.
shrink = no
@ -2347,6 +2366,10 @@ This section generates manifests for various desktop software that I'm using.
| dev | openjdk |
| dev | go |
| dev | gcc-toolchain |
| dev | lua |
| dev | libfaketime |
| dev | hugo-extended |
| dev | make |
### Manifests {#manifests}
@ -2731,6 +2754,8 @@ Other desktop programs I use are listed below.
| fontconfig | |
| polkit-gnome | Polkit authentication agent |
| anydesk | Remote desktop software |
| gnome-disk-utility | Manage disks |
| gparted | Manage partitions |
<a id="code-snippet--packages"></a>
```emacs-lisp

View file

@ -107,6 +107,7 @@ As with other files in the repo, parts prefixed with (OFF) are not used but kept
- [Configuration](#configuration)
- [Subterminal](#subterminal)
- [Dired integration](#dired-integration)
- [With-editor integration](#with-editor-integration)
- [Eshell](#eshell)
- [Org Mode](#org-mode)
- [Installation & basic settings](#installation-and-basic-settings)
@ -205,8 +206,10 @@ As with other files in the repo, parts prefixed with (OFF) are not used but kept
- [Meta Lisp](#meta-lisp)
- [Emacs Lisp](#emacs-lisp)
- [Package Lint](#package-lint)
- [General](#general)
- [General settings](#general-settings)
- [Common lisp](#common-lisp)
- [SLIME](#slime)
- [General settings](#general-settings)
- [Clojure](#clojure)
- [Hy](#hy)
- [Scheme](#scheme)
@ -734,7 +737,8 @@ I don't enable the entire package, just the modes I need.
comint
git-timemachine
magit
prodigy)))
prodigy
slime)))
```
@ -886,6 +890,7 @@ And winner-mode to keep the history of window states.
"h" 'previous-buffer
"k" 'kill-buffer
"b" 'persp-ivy-switch-buffer
"r" 'revert-buffer
"u" 'ibuffer)
```
@ -1562,7 +1567,9 @@ References:
(use-package yasnippet
:straight t
:config
(setq yas-snippet-dirs `(,(concat (expand-file-name user-emacs-directory) "snippets")))
(setq yas-snippet-dirs
`(,(concat (expand-file-name user-emacs-directory) "snippets")
yasnippet-snippets-dir))
(setq yas-triggers-in-field t)
(yas-global-mode 1))
@ -2486,6 +2493,21 @@ Keybindings:
```
#### With-editor integration {#with-editor-integration}
A package used by Magit to use the current Emacs instance as the `$EDITOR`.
That is, with the help of [this function]({{< relref "Console" >}}), I can just write `e <filename>`, edit the file, and then return to the same vterm buffer. No more running vim inside Emacs.
```emacs-lisp
(use-package with-editor
:straight t
:after (vterm)
:config
(add-hook 'vterm-mode-hook 'with-editor-export-editor))
```
### Eshell {#eshell}
A shell written in Emacs lisp. I don't use it as of now, but keep the config just in case.
@ -3162,7 +3184,7 @@ So, here is a list of queries results of which I want to see in the review templ
(todo "DONE")))
("Attended meetings" closed scheduled
(and
(tags "meeting")
(tags-inherited "meeting")
(todo "PASSED")))
("Done project tasks" closed deadline
(and
@ -4319,7 +4341,6 @@ Configs for various web development technologies I'm using.
| Type | Note |
|------|---------------------------------------------------|
| TODO | Do not enable for every Svelte mode |
| TODO | make expand div[disabled] as <div disabled></div> |
My bit of config here:
@ -5008,7 +5029,7 @@ A package that checks for the metadata in Emacs Lisp packages.
```
##### General {#general}
##### General settings {#general-settings}
```emacs-lisp
(add-hook 'emacs-lisp-mode-hook #'aggressive-indent-mode)
@ -5019,6 +5040,20 @@ A package that checks for the metadata in Emacs Lisp packages.
#### Common lisp {#common-lisp}
##### SLIME {#slime}
```emacs-lisp
(use-package slime
:straight t
:config
(setq inferior-lisp-program "sbcl")
(add-hook 'slime-repl-mode 'smartparens-mode))
```
##### General settings {#general-settings}
```emacs-lisp
(add-hook 'lisp-mode-hook #'aggressive-indent-mode)
;; (add-hook 'emacs-lisp-mode-hook #'smartparens-strict-mode)

View file

@ -19,15 +19,16 @@ As with other files in the repo, parts prefixed with (OFF) are not used but kept
- [Measure startup speed](#measure-startup-speed)
- [straight.el](#straight-dot-el)
- [use-package](#use-package)
- [config variants & environment](#config-variants-and-environment)
- [Performance](#performance)
- [Garbage collection](#garbage-collection)
- [Run garbage collection when Emacs is unfocused](#run-garbage-collection-when-emacs-is-unfocused)
- [Misc](#misc)
- [Native compilation](#native-compilation)
- [Anaconda & environment](#anaconda-and-environment)
- [Anaconda](#anaconda)
- [Custom file location](#custom-file-location)
- [Private config](#private-config)
- [No littering](#no-littering)
- [Prevent Emacs from closing](#prevent-emacs-from-closing)
- [Global editing configuration](#global-editing-configuration)
- [General keybindings stuff](#general-keybindings-stuff)
- [general.el](#general-dot-el)
@ -150,7 +151,9 @@ As with other files in the repo, parts prefixed with (OFF) are not used but kept
- [Keybindings & stuff](#keybindings-and-stuff)
- [Copy a link](#copy-a-link)
- [Presentations](#presentations)
- [TOC](#toc)
- [Tools](#tools)
- [TOC](#toc)
- [Screenshots](#screenshots)
- [System configuration](#system-configuration)
- [Tables for Guix Dependencies](#tables-for-guix-dependencies)
- [Noweb evaluations](#noweb-evaluations)
@ -171,7 +174,7 @@ As with other files in the repo, parts prefixed with (OFF) are not used but kept
- [<span class="org-todo done OFF">OFF</span> (OFF) Code Compass](#off--code-compass)
- [Dependencies](#dependencies)
- [Plugin](#plugin)
- [<span class="org-todo todo CHECK">CHECK</span> (OFF) Format-all](#off--format-all)
- [Reformatter](#reformatter)
- [General additional config](#general-additional-config)
- [Web development](#web-development)
- [Emmet](#emmet)
@ -225,7 +228,9 @@ As with other files in the repo, parts prefixed with (OFF) are not used but kept
- [fish](#fish)
- [sh](#sh)
- [Haskell](#haskell)
- [Lua](#lua)
- [JSON](#json)
- [SQL](#sql)
- [YAML](#yaml)
- [.env](#dot-env)
- [CSV](#csv)
@ -342,6 +347,56 @@ References:
```
### config variants & environment {#config-variants-and-environment}
The following variable is true when my machine is not powerful enough for some resource-heavy packages.
```emacs-lisp
(setq my/lowpower (string= (system-name) "azure"))
```
The following is true if Emacs is meant to be used with TRAMP over slow ssh.
```emacs-lisp
(setq my/slow-ssh
(or
(string= (getenv "IS_TRAMP") "true")
(string= (system-name) "dev-digital")))
```
The following is true is Emacs is ran on a remote server where I don't need stuff like my org workflow
```emacs-lisp
(setq my/remote-server
(or (string= (getenv "IS_REMOTE") "true")
(string= (system-name) "dev-digital")))
```
And the following is true if Emacs is run from termux on Android.
```emacs-lisp
(setq my/is-termux (string-match-p (rx (* nonl) "com.termux" (* nonl)) (getenv "HOME")))
```
Also, I sometimes need to know if a program is running inside Emacs (say, inside a terminal emulator). To do that, I set the following environment variable:
```emacs-lisp
(setenv "IS_EMACS" "true")
```
Finally, I want to have a minimal Emacs config for debugging purposes. This has just straight.el, use-packages and evil.
```emacs-lisp
<<minimal>>
```
To launch Emacs with this config, run
```bash
emacs -q -l ~/.emacs.d/init-minimal.el
```
### Performance {#performance}
@ -373,27 +428,6 @@ Some time has passed, and I still don't know if there is any quantifiable advant
```
#### Misc {#misc}
The following variable is true when my machine is not powerful enough for some resource-heavy packages.
```emacs-lisp
(setq my/lowpower (string= (system-name) "azure"))
```
The following is true if Emacs is meant to be used with TRAMP over slow ssh.
```emacs-lisp
(setq my/slow-ssh (string= (getenv "IS_TRAMP") "true"))
```
And the following is true if Emacs is run from termux on Android.
```emacs-lisp
(setq my/is-termux (string-match-p (rx (* nonl) "com.termux" (* nonl)) (getenv "HOME")))
```
#### Native compilation {#native-compilation}
Set number of jobs to 1 on low-power machines
@ -404,7 +438,7 @@ Set number of jobs to 1 on low-power machines
```
### Anaconda & environment {#anaconda-and-environment}
### Anaconda {#anaconda}
[Anaconda](https://www.anaconda.com/) is a free package and environment manager. I currently use it to manage multiple versions of Python and Node.js
@ -434,12 +468,6 @@ References:
(conda-env-activate "general")))
```
Also, I sometimes need to know if a program is running inside Emacs (say, inside a terminal emulator). To do that, I set the following environment variable:
```emacs-lisp
(setenv "IS_EMACS" "true")
```
### Custom file location {#custom-file-location}
@ -472,6 +500,15 @@ By default emacs and its packages create a lot files in `.emacs.d` and in other
```
### Prevent Emacs from closing {#prevent-emacs-from-closing}
This adds a confirmation to avoid accidental Emacs closing.
```emacs-lisp
(setq confirm-kill-emacs 'y-or-n-p)
```
## Global editing configuration {#global-editing-configuration}
@ -1437,7 +1474,7 @@ A company frontend with nice icons.
```emacs-lisp
(use-package company-box
:straight t
:if (not my/lowpower)
:if (and (display-graphic-p) (not my/lowpower))
:after (company)
:hook (company-mode . company-box-mode))
```
@ -1556,7 +1593,7 @@ Before I figure out how to package this for Guix:
```emacs-lisp
(use-package wakatime-mode
:straight (:host github :repo "SqrtMinusOne/wakatime-mode")
:if (not my/is-termux)
:if (not (or my/is-termux my/remote-server))
:config
(setq wakatime-ignore-exit-codes '(0 1 102))
(advice-add 'wakatime-init :after (lambda () (setq wakatime-cli-path "/home/pavel/bin/wakatime-cli")))
@ -1573,7 +1610,7 @@ Before I figure out how to package this for Guix:
(use-package activity-watch-mode
:straight t
:if (not my/is-termux)
:if (not (or my/is-termux my/remote-server))
:config
(global-activity-watch-mode))
```
@ -1692,7 +1729,9 @@ My colorscheme of choice.
:config
(setq doom-themes-enable-bold t
doom-themes-enable-italic t)
(load-theme 'doom-palenight t)
(if my/remote-server
(load-theme 'doom-gruvbox t)
(load-theme 'doom-palenight t))
(doom-themes-visual-bell-config)
(setq doom-themes-treemacs-theme "doom-colors")
(doom-themes-treemacs-config))
@ -1952,7 +1991,7 @@ References:
```emacs-lisp
(use-package emojify
:straight t
:if (not (or my/lowpower my/is-termux))
:if (and (display-graphic-p) (not (or my/lowpower my/is-termux)))
:hook (after-init . global-emojify-mode))
```
@ -1964,7 +2003,7 @@ Ligature setup for the JetBrainsMono font.
```emacs-lisp
(use-package ligature
:straight (:host github :repo "mickeynp/ligature.el")
:if (not my/is-termux)
:if (display-graphic-p)
:config
(ligature-set-ligatures
'(
@ -1980,7 +2019,8 @@ Ligature setup for the JetBrainsMono font.
clojure-mode
go-mode
sh-mode
haskell-mode)
haskell-mode
web-mode)
'("--" "---" "==" "===" "!=" "!==" "=!=" "=:=" "=/=" "<="
">=" "&&" "&&&" "&=" "++" "+++" "***" ";;" "!!" "??"
"?:" "?." "?=" "<:" ":<" ":>" ">:" "<>" "<<<" ">>>"
@ -2003,6 +2043,7 @@ Ligature setup for the JetBrainsMono font.
```emacs-lisp
(use-package all-the-icons
:if (display-graphic-p)
:straight t)
```
@ -2023,7 +2064,7 @@ Highlight indent guides.
```emacs-lisp
(use-package highlight-indent-guides
:straight t
:if (not my/lowpower)
:if (not (or my/lowpower my/remote-server))
:hook (
(prog-mode . highlight-indent-guides-mode)
(vue-mode . highlight-indent-guides-mode)
@ -2136,7 +2177,7 @@ Display icons for files.
```emacs-lisp
(use-package all-the-icons-dired
:straight t
:if (not (or my/lowpower my/slow-ssh))
:if (not (or my/lowpower my/slow-ssh (not (display-graphic-p))))
:hook (dired-mode . (lambda ()
(unless (string-match-p "/gnu/store" default-directory)
(all-the-icons-dired-mode))))
@ -2249,6 +2290,13 @@ Some other optimization settings:
tramp-file-name-regexp))
```
Set the default shell to `bin/bash` for TRAMP or on a remote server.
```emacs-lisp
(when (or my/remote-server my/slow-ssh)
(setq explicit-shell-file-name "/bin/bash"))
```
Also, here is a hack to make TRAMP find `ls` on Guix:
```emacs-lisp
@ -2390,6 +2438,7 @@ Open a terminal in the lower third of the frame with the `` ` `` key.
(kill-buffer (current-buffer))
(select-window vterm-window))
(vterm-other-window "vterm-subterminal"))))
(unless my/slow-ssh
(general-nmap "`" 'my/toggle-vterm-subteminal)
(general-nmap "~" 'vterm))
@ -2509,6 +2558,7 @@ Use the built-in org mode.
```emacs-lisp
(use-package org
:straight t
:if (not my/remote-server)
:defer t
:config
(setq org-startup-indented t)
@ -2884,7 +2934,7 @@ Used files
```emacs-lisp
(setq org-directory (expand-file-name "~/Documents/org-mode"))
(setq org-agenda-files '("inbox.org" "projects.org" "work.org"))
(setq org-agenda-files '("inbox.org" "projects.org" "work.org" "sem-11.org" "life.org"))
;; (setq org-default-notes-file (concat org-directory "/notes.org"))
```
@ -2903,7 +2953,9 @@ Refile targets
```emacs-lisp
(setq org-refile-targets
'(("projects.org" :maxlevel . 2)
("work.org" :maxlevel . 2)))
("work.org" :maxlevel . 2)
("sem-11.org" :maxlevel . 3)
("life.org" :maxlevel . 2)))
(setq org-refile-use-outline-path 'file)
(setq org-outline-path-complete-in-steps nil)
```
@ -3235,6 +3287,7 @@ A template looks like this:
```emacs-lisp
(use-package org-journal
:straight t
:if (not my/remote-server)
:after org
:config
(setq org-journal-dir (concat org-directory "/journal"))
@ -3305,7 +3358,8 @@ References:
(use-package org-roam
:straight (:host github :repo "org-roam/org-roam"
:files (:defaults "extensions/*.el"))
:files (:defaults "extensions/*.el"))
:if (not my/remote-server)
:after org
:init
(setq org-roam-directory (concat org-directory "/roam"))
@ -3392,6 +3446,7 @@ As of now, this package loads Helm on start. To avoid this, I have to exclude He
```emacs-lisp
(use-package org-ref
:straight (:files (:defaults (:exclude "*helm*")))
:if (not my/remote-server)
:init
(setq org-ref-completion-library 'org-ref-ivy-cite)
(setq bibtex-dialect 'biblatex)
@ -3698,6 +3753,7 @@ Doing presentations with [org-present](https://github.com/rlister/org-present).
(use-package org-present
:straight (:host github :repo "rlister/org-present")
:if (not my/remote-server)
:commands (org-present)
:config
(general-define-key
@ -3716,8 +3772,7 @@ Doing presentations with [org-present](https://github.com/rlister/org-present).
(setq-local org-format-latex-options
(plist-put org-format-latex-options
:scale (* org-present-text-scale my/org-latex-scale 0.5)))
(org-latex-preview '(16))
(tab-bar-mode 0)))
(org-latex-preview '(16))))
(add-hook 'org-present-mode-quit-hook
(lambda ()
(blink-cursor-mode 1)
@ -3728,12 +3783,16 @@ Doing presentations with [org-present](https://github.com/rlister/org-present).
(display-line-numbers-mode 1)
(hide-mode-line-mode 0)
(setq-local org-format-latex-options (plist-put org-format-latex-options :scale my/org-latex-scale))
(org-latex-preview '(64))
(tab-bar-mode 1))))
(org-latex-preview '(64)))))
```
### TOC {#toc}
### Tools {#tools}
Various small packages.
#### TOC {#toc}
Make a TOC inside the org file.
@ -3746,6 +3805,7 @@ References:
```emacs-lisp
(use-package org-make-toc
:after (org)
:if (not my/remote-server)
:commands
(org-make-toc
org-make-toc-insert
@ -3755,6 +3815,17 @@ References:
```
#### Screenshots {#screenshots}
A nice package to make screenshots and insert them to the Org document.
```emacs-lisp
(use-package org-attach-screenshot
:commands (org-attach-screenshot)
:straight t)
```
### System configuration {#system-configuration}
Functions used across my literate config files.
@ -3947,7 +4018,7 @@ References:
```emacs-lisp
(use-package lsp-mode
:straight t
:if (not (or my/slow-ssh my/is-termux))
:if (not (or my/slow-ssh my/is-termux my/remote-server))
:hook (
(typescript-mode . lsp)
(vue-mode . lsp)
@ -4000,6 +4071,7 @@ Origami should've leveraged LSP folding, but it was too unstable at the moment I
;; (add-hook 'lsp-after-open-hook #'lsp-origami-try-enable))
(use-package lsp-treemacs
:after (lsp)
:straight t
:commands lsp-treemacs-errors-list)
```
@ -4076,6 +4148,7 @@ References:
(use-package tree-sitter
:straight t
:if (not my/remote-server)
:hook ((typescript-mode . my/tree-sitter-if-not-mmm)
(js-mode . my/tree-sitter-if-not-mmm)
(python-mode . tree-sitter-mode)
@ -4204,10 +4277,12 @@ References:
```
#### <span class="org-todo todo CHECK">CHECK</span> (OFF) Format-all {#off--format-all}
#### Reformatter {#reformatter}
A general-purpose package to run formattters on files. While the most popular formatters are already packaged for Emacs, those that aren't can be invoked with this package.
```emacs-lisp
(use-package format-all
(use-package reformatter
:straight t)
```
@ -4870,7 +4945,6 @@ References:
- [LanguageTool homepage](https://languagetool.org/)
- [LanguageTool http server](https://dev.languagetool.org/http-server)
- [LanguageTool for Emacs repo](https://github.com/mhayashi1120/Emacs-langtool)
<!--listend-->
@ -4879,7 +4953,7 @@ References:
:straight t
:commands (langtool-check)
:config
(setq langtool-language-tool-server-jar "/home/pavel/Programs/LanguageTool-5.1/languagetool-server.jar")
(setq langtool-language-tool-server-jar "/home/pavel/bin/LanguageTool-5.4/languagetool-server.jar")
(setq langtool-mother-tongue "ru")
(setq langtool-default-language "en-US"))
@ -5358,6 +5432,18 @@ A function to start up [TensorBoard](https://www.tensorflow.org/tensorboard).
```
### Lua {#lua}
```emacs-lisp
(use-package lua-mode
:straight t
:mode "\\.lua\\'"
:hook (lua-mode . smartparens-mode))
(my/set-smartparens-indent 'lua-mode)
```
### JSON {#json}
```emacs-lisp
@ -5371,6 +5457,36 @@ A function to start up [TensorBoard](https://www.tensorflow.org/tensorboard).
```
### SQL {#sql}
[sql-formatter](https://github.com/zeroturnaround/sql-formatter) is a nice JavaScript package for pretty-printing SQL queries. It is not packaged for Emacs, so the easiest way to use it seems to be to define a custom formatter via [reformatter](https://github.com/purcell/emacs-reformatter).
Also, I've a simple function to switch dialects because I often alternate between them.
So far I didn't find a nice SQL client for Emacs, but I occasionally run SQL queries in Org Mode, so this qute package is handy.
```emacs-lisp
(setq my/sqlformatter-dialect-choice
'("db2" "mariadb" "mysql" "n1ql" "plsql" "postgresql" "redshift" "spark" "sql" "tsql"))
(setq my/sqlformatter-dialect "postgresql")
(defun my/sqlformatter-set-dialect ()
"Set dialect for sql-formatter"
(interactive)
(setq my/sqlformatter-dialect
(completing-read "Dialect: " my/sqlformatter-dialect-choice)))
(reformatter-define sqlformat
:program (executable-find "sql-formatter")
:args `("-l" ,my/sqlformatter-dialect))
(my-leader-def
:keymaps '(sql-mode-map)
"rr" #'sqlformat-buffer)
```
### YAML {#yaml}
```emacs-lisp
@ -5516,7 +5632,7 @@ Open a file managed by yadm.
My notmuch config now resides in [Mail.org]({{< relref "Mail" >}}).
```emacs-lisp
(unless my/is-termux
(unless (or my/is-termux my/remote-server)
(load-file (expand-file-name "mail.el" user-emacs-directory)))
```
@ -5532,12 +5648,13 @@ Using my own fork until the modifications are merged into master.
```emacs-lisp
(use-package elfeed
:straight (:repo "SqrtMinusOne/elfeed" :host github)
:if (not my/remote-server)
:commands (elfeed)
:init
(my-leader-def "ae" 'elfeed)
:config
(setq elfeed-db-directory "~/.elfeed")
(setq elfeed-enclosure-default-dir (expand-file-name "~"))
(setq elfeed-enclosure-default-dir (expand-file-name "~/Downloads"))
(advice-add #'elfeed-insert-html
:around
(lambda (fun &rest r)
@ -5655,6 +5772,7 @@ References:
```emacs-lisp
(use-package emms
:straight t
:if (not my/remote-server)
:commands (emms-smart-browse
emms-browser
emms-add-url
@ -5683,11 +5801,11 @@ References:
;; MPV setup
<<emms-mpv-setup>>
;; evil-lion and evil-commentary shadow some gX bindings
(add-hook 'emms-browser-mode-hook
(lambda ()
(evil-lion-mode -1)
;; (evil-commentary-mode -1)
))
;; (add-hook 'emms-browser-mode-hook
;; (lambda ()
;; (evil-lion-mode -1)
;; (evil-commentary-mode -1)
;; ))
;; I have everything I need in polybar
(emms-mode-line-mode -1)
(emms-playing-time-display-mode -1)
@ -5742,7 +5860,7 @@ After all this is done, run `M-x emms-cache-set-from-mpd-all` to set cache from
[mpv](https://mpv.io/) is a decent media player, which has found a place in this configuration because it integrates with youtube-dl.
```emacs-lisp
(add-to-list 'emms-player-list 'emms-player-mpv)
(add-to-list 'emms-player-list 'emms-player-mpv t)
```
Also a custom regex. My demands for MPV include running `youtube-dl`, so there is a regex that matches youtube.com or some of the video formats.
@ -5783,7 +5901,7 @@ Now `emms-add-url` should work on YouTube URLs just fine. Just keep in mind that
##### Cache cleanup {#cache-cleanup}
All added URLs reside in the EMMS cache after being played. I don't want them to stay there for a long time, so here is a handy function to clean it.
All the added URLs reside in the EMMS cache after being played. I don't want them to stay there for a long time, so here is a handy function to clean it.
```emacs-lisp
(defun my/emms-cleanup-urls ()
@ -6059,7 +6177,7 @@ References:
(shell-command-to-string (format "curl -L %s --output %s" tldr-source-zip-url tldr-saved-zip-path))
(when (file-exists-p "/tmp/tldr")
(delete-directory "/tmp/tldr" t))
(shell-command-to-string (format "unzip -d /tmp/tldr/ %s" tldr-saved-zip-path) nil nil)
(shell-command-to-string (format "unzip -d /tmp/tldr/ %s" tldr-saved-zip-path))
(when (file-exists-p tldr-directory-path)
(delete-directory tldr-directory-path 'recursive 'no-trash))
(shell-command-to-string (format "mv %s %s" "/tmp/tldr/tldr-main" tldr-directory-path))))
@ -6110,6 +6228,8 @@ Finally, there is also an Emacs plugin for [devdocs.io](https://devdocs.io).
I use [pass](https://www.passwordstore.org/) as my password manager. Expectedly, there is Emacs frontend for it.
Although I use [this rofi frontend](https://github.com/carnager/rofi-pass) for actually inserting passwords.
```emacs-lisp
(use-package pass
:straight t
@ -6249,6 +6369,7 @@ Tecosaur's plugin to make beautiful code screenshots.
```emacs-lisp
(use-package screenshot
:straight (:repo "tecosaur/screenshot" :host github :files ("screenshot.el"))
:if (display-graphic-p)
:commands (screenshot)
:init
(my-leader-def "S" 'screenshot))
@ -6340,14 +6461,14 @@ In order for this to work in Guix, a service is necessary - [Discord rich presen
:if (and (or
(string= (system-name) "indigo")
(string= (system-name) "eminence"))
(not my/slow-ssh))
(not my/slow-ssh)
(not my/remote-server))
:config
(elcord-mode)
(add-to-list 'elcord-boring-buffers-regexp-list
(rx bos (+ num) "-" (+ num) "-" (+ num) ".org" eos))
(add-to-list 'elcord-boring-buffers-regexp-list
(rx bos (= 14 num) "-" (* not-newline) ".org" eos))
)
(rx bos (= 14 num) "-" (* not-newline) ".org" eos)))
```

View file

@ -20,7 +20,6 @@ References:
<div class="heading">Table of Contents</div>
- [Contents](#contents)
- [Profiles](#profiles)
- [Activate profiles](#activate-profiles)
- [Update profiles](#update-profiles)
@ -49,34 +48,6 @@ References:
<!--endtoc-->
## Contents {#contents}
- [Contents](#contents)
- [Profiles](#profiles)
- [Activate profiles](#activate-profiles)
- [Update profiles](#update-profiles)
- [Channels](#channels)
- [Systems](#systems)
- [Base configuration](#base-configuration)
- [indigo](#indigo)
- [eminence](#eminence)
- [azure](#azure)
- [System installation](#system-installation)
- [Preparation](#preparation)
- [Installation](#installation)
- [After installation](#after-installation)
- [Misc software & notes](#misc-software-and-notes)
- [VPN](#vpn)
- [vpn-start](#vpn-start)
- [vpn-stop](#vpn-stop)
- [flatpak](#flatpak)
- [conda](#conda)
- [Slack](#slack)
- [virt-manager](#virt-manager)
- [wakatime-cli](#wakatime-cli)
- [Manifest](#manifest)
## Profiles {#profiles}
A profile is a way to group Guix packages. Amongst its advantages, profiles can be defined by manifests, which in turn can be stored in VCS.
@ -535,7 +506,7 @@ Fortunately, David Wilson has made [a repository](https://github.com/SystemCraft
When an ISO is there, we have to write it on a USB stick. Run `sudo fdisk -l` to get a list of disks.
The approach in the official instruction is to create a bootable USB with `dd`:
The approach given in the official instruction is to create a bootable USB with `dd`:
```text
sudo dd of=/dev/sdxX if=<path-to-iso> status=progress && sync
@ -553,7 +524,7 @@ Going further, the official instructions for installation & SystemCrafters wiki
After the installation, the strategy is as follows.
Set a password for the main user (pavel). Login with openbox to get a tolerable interface because the i3 default config is horrible.
Set a password for the main user (pavel). Login with openbox to get a tolerable interface because i3's default config is horrible.
[Connect to the internet](https://guix.gnu.org/en/manual/en/html%5Fnode/Keyboard-Layout-and-Networking-and-Partitioning.html#Keyboard-Layout-and-Networking-and-Partitioning).
@ -600,9 +571,9 @@ Don't forget to install `JetBrainsMono Nerd Font`.
| system | openvpn-update-resolve-conf |
| system | vpnc |
I'm not sure how to properly spin up VPN on Guix, so here is what I'm doing now, after some trial and error.
I'm not sure how to properly spin up VPN on Guix, so here is what ended I'm doing after some trial and error.
I'm currently using CyberGhost VPN. `~/.vpn` folder stores its OpenVPN config (`openvpn.ovpn`), modified as follows:
I'm using CyberGhost VPN. `~/.vpn` folder stores its OpenVPN config (`openvpn.ovpn`), modified as follows:
- paths to `ca`, `cert` and `key` are made absolute
@ -707,9 +678,9 @@ It is packaged for GNU Guix, although the definition has its fair share of worka
First, it's impossible to perform `conda init` to patch files like `.bashrc`, because the command is hell-bent on modifying `/gnu/store/`. So I do this manually, look for the `init_conda` procedures in [Console.org]({{< relref "Console" >}}).
Second, base environment root is `/gnu/store`, so don't install anything there.
Second, the base environment has `/gnu/store/...` as a root, so don't install anything there (and don't run `conda` with superuser rights!).
Third, by default it tries to create envronments in `/gnu/store`. I think it's enough to create one environment like this to fix it:
Third, by default it tries to create envronments in `/gnu/store`. It's enough to create one environment like this to fix it:
```sh
mkdir -p ~/.conda/envs
@ -723,7 +694,7 @@ Finally, I also want to have an ability to use global npm. Some settings for tha
So here is a script to set up conda hooks:
```bash
# Get writable conda envs with npm & without
# Get writable conda envs with npm & without it
readarray -t CONDA_ENVS_ALL <<< $(conda env list --json | jq '.envs[]')
CONDA_ENVS_NPM=()
CONDA_ENVS_NO_NPM=()

View file

@ -598,6 +598,7 @@ Don't forget to install `JetBrainsMono Nerd Font`.
|----------|-----------------------------|
| system | openvpn |
| system | openvpn-update-resolve-conf |
| system | vpnc |
I'm not sure how to properly spin up VPN on Guix, so here is what I'm doing now, after some trial and error.
@ -715,6 +716,8 @@ mkdir -p ~/.conda/envs
conda create -p ~/.conda/envs/test
```
Fourth, you may need to unset `$PYTHONPATH` if you have any global packages installed, otherwise Python from anaconda will try to import them instead of the conda versions.
Finally, I also want to have an ability to use global npm. Some settings for that are located in [Console.org](Console). Here we want to unset `NPM_CONFIG_USERCONFIG` if there is npm available in the environment.
So here is a script to set up conda hooks:

View file

@ -76,6 +76,8 @@ davmail.server=true
davmail.mode=Auto
davmail.url=https://mail.etu.ru/owa/
davmail.server.certificate.hash=0C:9E:CF:D3:62:26:DB:FA:F1:EE:36:9D:60:E7:31:71:CF:1F:92:85
davmail.caldavPort=1080
davmail.imapPort=1143
davmail.ldapPort=1389

View file

@ -13,7 +13,7 @@ The majority of the software is configured with [literate configuration](https:/
The files themselves are managed and deployed via [yadm](https://yadm.io/), but I mostly use Org Mode rich noweb whenever I can instead of what yadm offers.
My current GNU/Linux distribution is [GNU Guix](https://guix.gnu.org/). In the context of this repo, Guix allows me to list all the used programs in manifests, which means I have the same set of programs across multiple machines. Look for the tables with "Guix dependency" in the header.
My current GNU/Linux distribution is [GNU Guix](https://guix.gnu.org/). In the context of this repo, Guix allows me to list all the used programs in manifests, which means I have the same set of programs across multiple machines. Look for tables with "Guix dependency" in the header.
Literate configuration files:

View file

@ -400,6 +400,11 @@ alias cii<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;ex
bind <span style="color:#a6e22e">-M</span> insert <span style="color:#ae81ff">\e</span>h backward<span style="color:#a6e22e">-char</span>
bind <span style="color:#a6e22e">-M</span> insert <span style="color:#ae81ff">\e</span>w forward<span style="color:#a6e22e">-word</span>
bind <span style="color:#a6e22e">-M</span> insert <span style="color:#ae81ff">\e</span>b backward<span style="color:#a6e22e">-word</span>
</code></pre></div><h3 id="functions">Functions</h3>
<p>A small function to open the file with <code>$EDITOR</code>.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-fish" data-lang="fish"><span style="color:#66d9ef">function</span> <span style="color:#a6e22e">e</span>
eval $EDITOR $argv
<span style="color:#66d9ef">end</span>
</code></pre></div><h2 id="nushell">Nushell</h2>
<table>
<thead>

View file

@ -216,6 +216,7 @@
<li><a href="#configuration">Configuration</a></li>
<li><a href="#subterminal">Subterminal</a></li>
<li><a href="#dired-integration">Dired integration</a></li>
<li><a href="#with-editor-integration">With-editor integration</a></li>
</ul>
</li>
<li><a href="#eshell">Eshell</a></li>
@ -381,10 +382,15 @@
<li><a href="#emacs-lisp">Emacs Lisp</a>
<ul>
<li><a href="#package-lint">Package Lint</a></li>
<li><a href="#general">General</a></li>
<li><a href="#general-settings">General settings</a></li>
</ul>
</li>
<li><a href="#common-lisp">Common lisp</a>
<ul>
<li><a href="#slime">SLIME</a></li>
<li><a href="#general-settings">General settings</a></li>
</ul>
</li>
<li><a href="#common-lisp">Common lisp</a></li>
<li><a href="#clojure">Clojure</a></li>
<li><a href="#hy">Hy</a></li>
<li><a href="#scheme">Scheme</a></li>
@ -777,7 +783,8 @@
comint
git-timemachine
magit
prodigy)))
prodigy
slime)))
</code></pre></div><h3 id="more-keybindings">More keybindings</h3>
<p>The main keybindings setup is positioned after evil mode to take the latter into account.</p>
<h4 id="escape-key">Escape key</h4>
@ -877,6 +884,7 @@
<span style="color:#e6db74">&#34;h&#34;</span> <span style="color:#e6db74">&#39;previous-buffer</span>
<span style="color:#e6db74">&#34;k&#34;</span> <span style="color:#e6db74">&#39;kill-buffer</span>
<span style="color:#e6db74">&#34;b&#34;</span> <span style="color:#e6db74">&#39;persp-ivy-switch-buffer</span>
<span style="color:#e6db74">&#34;r&#34;</span> <span style="color:#e6db74">&#39;revert-buffer</span>
<span style="color:#e6db74">&#34;u&#34;</span> <span style="color:#e6db74">&#39;ibuffer</span>)
</code></pre></div><h4 id="xref">xref</h4>
<p>Some keybindings for xref and go to definition.</p>
@ -1371,7 +1379,9 @@
(use-package yasnippet
:straight <span style="color:#66d9ef">t</span>
:config
(setq yas-snippet-dirs <span style="color:#f92672">`</span>(<span style="color:#f92672">,</span>(<span style="color:#a6e22e">concat</span> (<span style="color:#a6e22e">expand-file-name</span> user-emacs-directory) <span style="color:#e6db74">&#34;snippets&#34;</span>)))
(setq yas-snippet-dirs
<span style="color:#f92672">`</span>(<span style="color:#f92672">,</span>(<span style="color:#a6e22e">concat</span> (<span style="color:#a6e22e">expand-file-name</span> user-emacs-directory) <span style="color:#e6db74">&#34;snippets&#34;</span>)
yasnippet-snippets-dir))
(setq yas-triggers-in-field <span style="color:#66d9ef">t</span>)
(yas-global-mode <span style="color:#ae81ff">1</span>))
@ -2061,6 +2071,14 @@
:states <span style="color:#f92672">&#39;</span>(normal)
<span style="color:#e6db74">&#34;gd&#34;</span> <span style="color:#a6e22e">#&#39;</span>my/vterm-dired-other-window
<span style="color:#e6db74">&#34;gD&#34;</span> <span style="color:#a6e22e">#&#39;</span>my/vterm-dired-replace))
</code></pre></div><h4 id="with-editor-integration">With-editor integration</h4>
<p>A package used by Magit to use the current Emacs instance as the <code>$EDITOR</code>.</p>
<p>That is, with the help of <a href="/configs/console/">this function</a>, I can just write <code>e &lt;filename&gt;</code>, edit the file, and then return to the same vterm buffer. No more running vim inside Emacs.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package with-editor
:straight <span style="color:#66d9ef">t</span>
:after (vterm)
:config
(add-hook <span style="color:#e6db74">&#39;vterm-mode-hook</span> <span style="color:#e6db74">&#39;with-editor-export-editor</span>))
</code></pre></div><h3 id="eshell">Eshell</h3>
<p>A shell written in Emacs lisp. I don&rsquo;t use it as of now, but keep the config just in case.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(defun my/configure-eshell ()
@ -2541,7 +2559,7 @@
(todo <span style="color:#e6db74">&#34;DONE&#34;</span>)))
(<span style="color:#e6db74">&#34;Attended meetings&#34;</span> closed scheduled
(and
(tags <span style="color:#e6db74">&#34;meeting&#34;</span>)
(tags-inherited <span style="color:#e6db74">&#34;meeting&#34;</span>)
(todo <span style="color:#e6db74">&#34;PASSED&#34;</span>)))
(<span style="color:#e6db74">&#34;Done project tasks&#34;</span> closed deadline
(and
@ -3420,10 +3438,6 @@ MimeType=x-scheme-handler/org-protocol
<tbody>
<tr>
<td>TODO</td>
<td>Do not enable for every Svelte mode</td>
</tr>
<tr>
<td>TODO</td>
<td>make expand div[disabled] as <div disabled></div></td>
</tr>
</tbody>
@ -3981,11 +3995,18 @@ MimeType=x-scheme-handler/org-protocol
:after flycheck
:config
(flycheck-package-setup))
</code></pre></div><h5 id="general">General</h5>
</code></pre></div><h5 id="general-settings">General settings</h5>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(add-hook <span style="color:#e6db74">&#39;emacs-lisp-mode-hook</span> <span style="color:#a6e22e">#&#39;</span>aggressive-indent-mode)
<span style="color:#75715e">;; (add-hook &#39;emacs-lisp-mode-hook #&#39;smartparens-strict-mode)</span>
(add-hook <span style="color:#e6db74">&#39;emacs-lisp-mode-hook</span> <span style="color:#a6e22e">#&#39;</span>lispy-mode)
</code></pre></div><h4 id="common-lisp">Common lisp</h4>
<h5 id="slime">SLIME</h5>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package slime
:straight <span style="color:#66d9ef">t</span>
:config
(setq inferior-lisp-program <span style="color:#e6db74">&#34;sbcl&#34;</span>)
(add-hook <span style="color:#e6db74">&#39;slime-repl-mode</span> <span style="color:#e6db74">&#39;smartparens-mode</span>))
</code></pre></div><h5 id="general-settings">General settings</h5>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(add-hook <span style="color:#e6db74">&#39;lisp-mode-hook</span> <span style="color:#a6e22e">#&#39;</span>aggressive-indent-mode)
<span style="color:#75715e">;; (add-hook &#39;emacs-lisp-mode-hook #&#39;smartparens-strict-mode)</span>
(add-hook <span style="color:#e6db74">&#39;lisp-mode-hook</span> <span style="color:#a6e22e">#&#39;</span>lispy-mode)

View file

@ -72,7 +72,6 @@
<div></div>
<div class="heading">Table of Contents</div>
<ul>
<li><a href="#contents">Contents</a></li>
<li><a href="#profiles">Profiles</a>
<ul>
<li><a href="#activate-profiles">Activate profiles</a></li>
@ -114,48 +113,6 @@
</ul>
</div>
<!--endtoc-->
<h2 id="contents">Contents</h2>
<ul>
<li><a href="#contents">Contents</a></li>
<li><a href="#profiles">Profiles</a>
<ul>
<li><a href="#activate-profiles">Activate profiles</a></li>
<li><a href="#update-profiles">Update profiles</a></li>
</ul>
</li>
<li><a href="#channels">Channels</a></li>
<li><a href="#systems">Systems</a>
<ul>
<li><a href="#base-configuration">Base configuration</a></li>
<li><a href="#indigo">indigo</a></li>
<li><a href="#eminence">eminence</a></li>
<li><a href="#azure">azure</a></li>
</ul>
</li>
<li><a href="#system-installation">System installation</a>
<ul>
<li><a href="#preparation">Preparation</a></li>
<li><a href="#installation">Installation</a></li>
<li><a href="#after-installation">After installation</a></li>
</ul>
</li>
<li><a href="#misc-software-and-notes">Misc software &amp; notes</a>
<ul>
<li><a href="#vpn">VPN</a>
<ul>
<li><a href="#vpn-start">vpn-start</a></li>
<li><a href="#vpn-stop">vpn-stop</a></li>
</ul>
</li>
<li><a href="#flatpak">flatpak</a></li>
<li><a href="#conda">conda</a></li>
<li><a href="#slack">Slack</a></li>
<li><a href="#virt-manager">virt-manager</a></li>
<li><a href="#wakatime-cli">wakatime-cli</a></li>
<li><a href="#manifest">Manifest</a></li>
</ul>
</li>
</ul>
<h2 id="profiles">Profiles</h2>
<p>A profile is a way to group Guix packages. Amongst its advantages, profiles can be defined by manifests, which in turn can be stored in VCS.</p>
<p>References:</p>
@ -518,14 +475,14 @@ profiles<span style="color:#f92672">=</span>$*
<p>In my case, the provided ISO doesn&rsquo;t work because of the Libre kernel.</p>
<p>Fortunately, David Wilson has made <a href="https://github.com/SystemCrafters/guix-installer">a repository</a> with a toolchain to make an ISO with the full kernel. In case it won&rsquo;t be an option, the <a href="https://gitlab.com/nonguix/nonguix">nonguix repo</a> also has instructions on how to do that.</p>
<p>When an ISO is there, we have to write it on a USB stick. Run <code>sudo fdisk -l</code> to get a list of disks.</p>
<p>The approach in the official instruction is to create a bootable USB with <code>dd</code>:</p>
<p>The approach given in the official instruction is to create a bootable USB with <code>dd</code>:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-text" data-lang="text">sudo dd of=/dev/sdxX if=&lt;path-to-iso&gt; status=progress &amp;&amp; sync
</code></pre></div><p>However, I couldn&rsquo;t make it work for some strange reason. Fortunately, <code>gnome-disk-utility</code> was able to produce a bootable USB.</p>
<h3 id="installation">Installation</h3>
<p>Going further, the official instructions for installation &amp; SystemCrafters wiki entry are pretty good, so it&rsquo;s not necessary to repeat them here.</p>
<h3 id="after-installation">After installation</h3>
<p>After the installation, the strategy is as follows.</p>
<p>Set a password for the main user (pavel). Login with openbox to get a tolerable interface because the i3 default config is horrible.</p>
<p>Set a password for the main user (pavel). Login with openbox to get a tolerable interface because i3&rsquo;s default config is horrible.</p>
<p><a href="https://guix.gnu.org/en/manual/en/html%5Fnode/Keyboard-Layout-and-Networking-and-Partitioning.html#Keyboard-Layout-and-Networking-and-Partitioning">Connect to the internet</a>.</p>
<p>Clone the dotfiles repo:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-text" data-lang="text">mkdir Code
@ -584,8 +541,8 @@ guix clone https://github.com/SqrtMinusOne/dotfiles.git
</tr>
</tbody>
</table>
<p>I&rsquo;m not sure how to properly spin up VPN on Guix, so here is what I&rsquo;m doing now, after some trial and error.</p>
<p>I&rsquo;m currently using CyberGhost VPN. <code>~/.vpn</code> folder stores its OpenVPN config (<code>openvpn.ovpn</code>), modified as follows:</p>
<p>I&rsquo;m not sure how to properly spin up VPN on Guix, so here is what ended I&rsquo;m doing after some trial and error.</p>
<p>I&rsquo;m using CyberGhost VPN. <code>~/.vpn</code> folder stores its OpenVPN config (<code>openvpn.ovpn</code>), modified as follows:</p>
<ul>
<li>
<p>paths to <code>ca</code>, <code>cert</code> and <code>key</code> are made absolute</p>
@ -657,14 +614,14 @@ nmcli connection up <span style="color:#e6db74">&#34;</span>$CONN<span style="co
<p><a href="https://docs.conda.io/en/latest/">conda</a> is a package manager, which I use for managing various versions of Python &amp; Node.js.</p>
<p>It is packaged for GNU Guix, although the definition has its fair share of workarounds. It is almost surprising to see it work with all the C libraries and stuff. But there are still some problems.</p>
<p>First, it&rsquo;s impossible to perform <code>conda init</code> to patch files like <code>.bashrc</code>, because the command is hell-bent on modifying <code>/gnu/store/</code>. So I do this manually, look for the <code>init_conda</code> procedures in <a href="/configs/console/">Console.org</a>.</p>
<p>Second, base environment root is <code>/gnu/store</code>, so don&rsquo;t install anything there.</p>
<p>Third, by default it tries to create envronments in <code>/gnu/store</code>. I think it&rsquo;s enough to create one environment like this to fix it:</p>
<p>Second, the base environment has <code>/gnu/store/...</code> as a root, so don&rsquo;t install anything there (and don&rsquo;t run <code>conda</code> with superuser rights!).</p>
<p>Third, by default it tries to create envronments in <code>/gnu/store</code>. It&rsquo;s enough to create one environment like this to fix it:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-sh" data-lang="sh">mkdir -p ~/.conda/envs
conda create -p ~/.conda/envs/test
</code></pre></div><p>Fourth, you may need to unset <code>$PYTHONPATH</code> if you have any global packages installed, otherwise Python from anaconda will try to import them instead of the conda versions.</p>
<p>Finally, I also want to have an ability to use global npm. Some settings for that are located in <a href="Console">Console.org</a>. Here we want to unset <code>NPM_CONFIG_USERCONFIG</code> if there is npm available in the environment.</p>
<p>So here is a script to set up conda hooks:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash"><span style="color:#75715e"># Get writable conda envs with npm &amp; without</span>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash"><span style="color:#75715e"># Get writable conda envs with npm &amp; without it</span>
readarray -t CONDA_ENVS_ALL <span style="color:#f92672">&lt;&lt;&lt;</span> <span style="color:#66d9ef">$(</span>conda env list --json | jq <span style="color:#e6db74">&#39;.envs[]&#39;</span><span style="color:#66d9ef">)</span>
CONDA_ENVS_NPM<span style="color:#f92672">=()</span>
CONDA_ENVS_NO_NPM<span style="color:#f92672">=()</span>

View file

@ -50,7 +50,7 @@ As with other files in the repo, parts prefixed with (OFF) are not used but kept
<description>GNU Guix is (1) a transactional package manager and (2) a GNU/Linux distribution.
My personal selling points are declarative package configuration and transactional upgrades.
References:
Official help System Crafters wiki Pjotr Prins&#39; Guix notes Davil Wilson&amp;rsquo;s YouTube series Table of Contents Contents Profiles Activate profiles Update profiles Channels Systems Base configuration indigo eminence azure System installation Preparation Installation After installation Misc software &amp;amp; notes VPN vpn-start vpn-stop flatpak conda Slack virt-manager wakatime-cli Manifest Contents Contents Profiles Activate profiles Update profiles Channels Systems Base configuration indigo eminence azure System installation Preparation Installation After installation Misc software &amp;amp; notes VPN vpn-start vpn-stop flatpak conda Slack virt-manager wakatime-cli Manifest Profiles A profile is a way to group Guix packages.</description>
Official help System Crafters wiki Pjotr Prins&#39; Guix notes Davil Wilson&amp;rsquo;s YouTube series Table of Contents Profiles Activate profiles Update profiles Channels Systems Base configuration indigo eminence azure System installation Preparation Installation After installation Misc software &amp;amp; notes VPN vpn-start vpn-stop flatpak conda Slack virt-manager wakatime-cli Manifest Profiles A profile is a way to group Guix packages.</description>
</item>
<item>

View file

@ -125,6 +125,8 @@ gmi set --ignore-tags-local new
<span style="color:#a6e22e">davmail.mode</span><span style="color:#f92672">=</span><span style="color:#e6db74">Auto</span>
<span style="color:#a6e22e">davmail.url</span><span style="color:#f92672">=</span><span style="color:#e6db74">https://mail.etu.ru/owa/</span>
<span style="color:#a6e22e">davmail.server.certificate.hash</span><span style="color:#f92672">=</span><span style="color:#e6db74">0C:9E:CF:D3:62:26:DB:FA:F1:EE:36:9D:60:E7:31:71:CF:1F:92:85</span>
<span style="color:#a6e22e">davmail.caldavPort</span><span style="color:#f92672">=</span><span style="color:#e6db74">1080</span>
<span style="color:#a6e22e">davmail.imapPort</span><span style="color:#f92672">=</span><span style="color:#e6db74">1143</span>
<span style="color:#a6e22e">davmail.ldapPort</span><span style="color:#f92672">=</span><span style="color:#e6db74">1389</span>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 60 KiB