- Makefile 62.4%
- Scheme 37.6%
| configs | Update magit for the package-vc-install method | |
| LICENSES | Make the repo REUSE compatible, rearrange all the scripts | |
| .envrc | Make the repo REUSE compatible, rearrange all the scripts | |
| .gitignore | Fix Makefile issues, fix SSH client config order | |
| channels-lock.scm | Update channels | |
| channels-lock.scm.license | Make the repo REUSE compatible, rearrange all the scripts | |
| channels.scm | Make the repo REUSE compatible, rearrange all the scripts | |
| make.config.example | Fix Makefile issues, fix SSH client config order | |
| Makefile | Use wildcard function for optional prerequisites | |
| manifest.scm | Add emacs-citar, update channels | |
| README.org | Update channels, various small fixes | |
Gábor Udvari's dotfiles
- Requirements
- Installation
- Windows notes
- Configurations
- Other literate configs for inspiration
- Future plans
All the dotfiles are maintained in org-mode files as literate configuration. This was done in the hope that the different snippets can be understood and copied separately regardless of your own dotfiles solution. Feel free to browse through the different files and use whatever you like.
Requirements
For installation you will need the following software installed already:
makeemacs-
one of the following:
guixstowrsync
Preparing the requirements on Windows
Here are some steps to be able to bootstrap the above tools:
- Download the RefreshEnv.cmd from the Chocolatey Project to make editing the PATH variable quicker: https://github.com/chocolatey/choco/blob/stable/src/chocolatey.resources/redirects/RefreshEnv.cmd
- Download Zstd from the official repository, so that we can uncompress Msys2 packages: https://github.com/facebook/zstd/releases/latest
-
Add the Zstd folder to your users environment variables. Press Windows+R, and launch the following command to open up the environment variable editing window:
rundll32.exe sysdm.cpl,EditEnvironmentVariablesOnce you added it, use the RefreshEnv.cmd from step 2 to update the variables.
From this point onwards you have two options, either use MSYS2 or Cygwin packages. The difference between the two is that Cygwin aims to be an environment to simulate Unix, while MSYS2 packages are native Windows applications. A practical example of this is that the Cygwin packaged tmux only works if you launch it from the Cygwin packaged bash, but not from the MSYS2 packaged bash. Also Git for Windows is based on MSYS2 as well, so you might already have it installed.
MSYS2
- Save time and effort by installing Git for Windows. This will get you a good base and some additional packages. https://gitforwindows.org/
-
Download the Make package with this command, all the dependencies are covered with Git for Windows:
NOTE: there is a bug in curl 8.8.0, the below command will fail with an error message. Curl 8.7 and 8.9 are not affected. https://github.com/curl/curl/issues/13845
curl -L -O -w '%{filename_effective}' https://mirror.msys2.org/msys/x86_64/make-4.4.1-2-x86_64.pkg.tar.zst | xargs tar -C ~/.local --zstd -xvf -
Download the Rsync packages with the following commands, all the other dependencies are covered with Git for Windows:
curl -L -O -w '%{filename_effective}' https://mirror.msys2.org/msys/x86_64/rsync-3.3.0-1-x86_64.pkg.tar.zst | xargs tar -C ~/.local --zstd -xvf curl -L -O -w '%{filename_effective}' https://mirror.msys2.org/msys/x86_64/libxxhash-0.8.2-1-x86_64.pkg.tar.zst | xargs tar -C ~/.local --zstd -xvf
Cygwin
Download and install the Cygwin, Gettext, Make packages with these commands:
mkdir -p ~/.local
cd "$(mktemp -d)"
export MIRROR='https://mirror.accum.se/mirror/cygwin/x86_64/release'
curl -L -O -w '%{filename_effective}' "$MIRROR"/cygwin/cygwin-3.6.0-0.115.g579064bf4d40.tar.xz | xargs tar -C ~/.local -xvJf
curl -L -O -w '%{filename_effective}' "$MIRROR"/gcc/libgcc1/libgcc1-13.2.1+20240203-0.1.tar.zst | xargs tar -C ~/.local --zstd -xvf
curl -L -O -w '%{filename_effective}' "$MIRROR"/zstd/zstd-1.5.6-1.tar.zst | xargs tar -C ~/.local --zstd -xvf
curl -L -O -w '%{filename_effective}' "$MIRROR"/zlib/zlib-1.3.1-1.tar.zst| xargs tar -C ~/.local --zstd -xvf
curl -L -O -w '%{filename_effective}' "$MIRROR"/libiconv/libiconv2/libiconv2-1.17-1.tar.xz | xargs tar -C ~/.local -xvJf
curl -L -O -w '%{filename_effective}' "$MIRROR"/gettext/libintl8/libintl8-0.22.4-1.tar.xz | xargs tar -C ~/.local -xvJf
curl -L -O -w '%{filename_effective}' "$MIRROR"/make/make-4.4.1-2.tar.xz | xargs tar -C ~/.local -xvJf
curl -L -O -w '%{filename_effective}' "$MIRROR"/libxcrypt/libcrypt2/libcrypt2-4.4.20-1.tar.xz | xargs tar -C ~/.local -xvJf
curl -L -O -w '%{filename_effective}' "$MIRROR"/libffi/libffi8/libffi8-3.4.6-1.tar.xz | xargs tar -C ~/.local -xvJf
curl -L -O -w '%{filename_effective}' "$MIRROR"/libgc/libgc1/libgc1-8.2.6-1.tar.xz | xargs tar -C ~/.local -xvJf
curl -L -O -w '%{filename_effective}' "$MIRROR"/gmp/libgmp10/libgmp10-6.3.0-1.tar.zst | xargs tar -C ~/.local --zstd -xvf
curl -L -O -w '%{filename_effective}' "$MIRROR"/libunistring/libunistring5/libunistring5-1.2-1.tar.xz | xargs tar -C ~/.local -xvJf
curl -L -O -w '%{filename_effective}' "$MIRROR"/guile3.0/libguile3.0_1/libguile3.0_1-3.0.9-3.tar.xz | xargs tar -C ~/.local -xvJf
Known issues with Windows
Password prompts on MSYS2
If the password prompts are not showing up inside your Git Bash (MSYS2), eg. for the pass or passage programs, then you have two options:
- The modern solution is to use the new Microsoft Terminal which supports the new ConPTY pseudo console. Also make sure to have a new enough Git for Windows, and maybe try setting the
MSYS=enable_pconenvironment variable: https://github.com/mintty/wsltty/issues/271#issuecomment-1429789254 This should be the default since September 2022, but I also needed to set it manually. -
The legacy solution is to use winpty:
- https://superuser.com/a/1322277.
- https://gitforwindows.org/faq.html#some-native-console-programs-dont-work-when-run-from-git-bash-how-to-fix-it
It is possible to force pipe redirection with the
-Xallow-non-ttyoption, but in that case the text asking for the password will also be redirected to the pipe. So something like this:winpty -Xallow-non-tty age -p -a age-test >age-test.ageWill result in a file like this:
Enter passphrase (leave empty to autogenerate a secure one): ←[F←[KConfirm passphrase: ←[F←[K-----BEGIN AGE ENCRYPTED FILE----- ... -----END AGE ENCRYPTED FILE-----
Bash is running inside the default WSL distro instead of MSYS2 or Cygwin
If you install WSL, then Windows will put a bash.exe file inside the C:\Windows\System32 folder. This folder is included in the system wide PATH environment variable, therefore it has the highest priority. So if you have a shell script with this shebang:
#!/usr/bin/env bash
Then the bash inside your default WSL distro will continue to execute the shell script, not the bash you installed with either MSYS2 (Git for Windows) or Cygwin.
Currently there is no option to remove the bash from System32:
https://github.com/microsoft/WSL/discussions/9681
MSYS2 and Cygwin are overriding these solutions, so make sure to launch the problematic programs from those shells. If you cannot do that, then make sure to launch the correct bash before the actual script, eg.:
this will not work:
$ which passage
/c/Users/User/.local/bin/passage
$ winpty passage --version
winpty: error: cannot start 'passage': Not found in PATH
but this will:
$ which passage
/c/Users/User/.local/bin/passage
$ winpty bash passage --version
============================================
= passage: age-backed password manager =
= =
= v1.7.4 =
...
Preparing the requirements with Guix
If you already have guix installed on your system, then you can launch a shell with all of the required libraries with the following command:
guix shell --search-paths --manifest=manifest.scm
The repository also has a direnv config file, if you also have that, then the above command will be run for you whenever you step into the directory of the repository.
Installation
You can compile the whole config by running make in the repository. The Makefile will run emacs to extract all the actual configuration files first, and then it will put them into the correct folder. If guix is found, then it will do a guix home reconfigure. If guix is not found, then it will try to link the config files with stow or rsync.
Extracting the configuration files
You will need to start from an Emacs installation with org-mode configured. All the actual configuration files are stored in org-mode files and they need to be extracted into their own actual files.
emacs --batch --eval "(require 'org)" --eval '(org-babel-tangle-file "README.org")'
Linking the configuration files
Once the configuration files are present in the build folder, then they can be linked to their final place inside the users home folder. If guix is installed, then the guix home will be reconfigured to install every package and link the configuration files as well. If not, then stow will symlink the files, if also stow is not found, then rsync will simply copy the files based on their modified time.
Guix home reconfiguration
Once the configuration files are extracted from the org-mode documentations, the Guix Home needs to be reconfigured.
guix home reconfigure -L build guix-home-config.scm
Stow linking
https://www.gnu.org/software/stow/
If guix cannot be found, then make will search for stow. If it finds stow, then it will link all the build/home files with it to the users actual home directory.
stow --no-folding --dir=./build --target ~/ home
Note: Stow can run under Windows, but the symbolic links created with Stow does not seem to work with the Windows version of Emacs. If you are on Windows use Rsync as described below.
Rsync copying
If neither guix nor stow can be found, then make will search for rsync. If it finds rsync, then it will copy all the build/home files to the users actual home directory.
rsync -avr build/home/ ~/
Windows notes
The default folder for Emacs configuration in Windows is the AppData/Roaming folder. The dotfiles configuration will move them inside the usual ~/.config/emacs folder. Because of this you need to launch Emacs with the following command:
runemacs --init-directory %USERPROFILE%/.config/emacs
Additionally the server-auth-dir will be set to the same value as the no-littering package would put it. So if you need to create a shortcut for emacsclient, you need to do it like this:
emacsclientw.exe --server-file %USERPROFILE%/.config/emacs/var/server/auth/server -r
Configurations
The order in which the configuration files get tangled is important. The guix-home-head.org file needs to come first, all the rest of the files can come in any order, and the last file needs to be the guix-home.org file.
It is also important to be able to control the list of configuration files with variable. There should be one basic list for a general usage, headless Linux servers etc., and one extended list with games, graphical environments. Currently the Makefile handles this, take a look into the make.config.example file for reference.
Table of Contents
- /gabor-udvari/dotfiles/src/branch/main/configs/10-guix-home-head.org
- /gabor-udvari/dotfiles/src/branch/main/configs/20-autohotkeys.org
- /gabor-udvari/dotfiles/src/branch/main/configs/20-bash.org
- /gabor-udvari/dotfiles/src/branch/main/configs/20-bash-scripts-extra.org
- /gabor-udvari/dotfiles/src/branch/main/configs/20-bash-scripts.org
- /gabor-udvari/dotfiles/src/branch/main/configs/20-containers.org
- /gabor-udvari/dotfiles/src/branch/main/configs/20-desktop.org
- /gabor-udvari/dotfiles/src/branch/main/configs/20-dictionaries.org
- /gabor-udvari/dotfiles/src/branch/main/configs/20-emacs.org
- /gabor-udvari/dotfiles/src/branch/main/configs/20-encryption.org
- /gabor-udvari/dotfiles/src/branch/main/configs/20-games.org
- /gabor-udvari/dotfiles/src/branch/main/configs/20-general.org
- /gabor-udvari/dotfiles/src/branch/main/configs/20-git.org
- /gabor-udvari/dotfiles/src/branch/main/configs/20-hledger.org
- /gabor-udvari/dotfiles/src/branch/main/configs/20-latex.org
- /gabor-udvari/dotfiles/src/branch/main/configs/20-mail.org
- /gabor-udvari/dotfiles/src/branch/main/configs/20-multimedia.org
- /gabor-udvari/dotfiles/src/branch/main/configs/20-ssh.org
- /gabor-udvari/dotfiles/src/branch/main/configs/20-tmux.org
- /gabor-udvari/dotfiles/src/branch/main/configs/20-vim.org
- /gabor-udvari/dotfiles/src/branch/main/configs/90-guix-home.org
Other literate configs for inspiration
Future plans
TODO Concat the org files inside Emacs
Currently the final org file is created with cat, the order of the sections is kept due to the numbered filenames. There must be something better, eg. Algernon is using org-roam-list-files:
https://git.madhouse-project.org/algernon/infrastructure.org/src/branch/main/tools/entangle.el
TODO Make the gpg-agent.conf place customizable
The place of the gpg-agent.conf file is hard wired in the Guix home service to be inside $HOME/.gnupg. It is possible to move this folder to an XDG compatible one, but the home service needs to be improved.