Hello all. I hope I am posting in the correct place.
I have recently installed nixos on my laptop, to try it out. This means that my knowledge about the system is shallow, to say the least. Everything was going great, until I tried to install the editor I use, doom emacs. I tried installing it as I would on any other linux os.
In the installation section, there are two commands that need to be ran. It consistently fails, though on different stages, and the problem seems to be caused by failing to connect to github. Below are 3 examples of outputs.
fatal: unable to access 'https://github.com/doomemacs/doomemacs/': Could not resolve host: github.com
Cloning into '/home/canos/.config/emacs'...
remote: Enumerating objects: 1157, done.
remote: Counting objects: 100% (1157/1157), done.
remote: Compressing objects: 100% (1045/1045), done.
remote: Total 1157 (delta 85), reused 505 (delta 69), pack-reused 0
Receiving objects: 100% (1157/1157), 1.13 MiB | 1.15 MiB/s, done.
Resolving deltas: 100% (85/85), done.
Installing Doom Emacs!
- Skipping ~/.config/doom/ (already exists)
- Skipping init.el (already exists)
- Skipping config.el (already exists)
- Skipping packages.el (already exists)
Generate an envvar file? (see `doom help env` for details) (y or n) y
> Generating envvars file
âś“ Generated ~/.config/emacs/.local/env
Installing plugins
> Installing straight...
x There was an unexpected runtime error
Message: File is missing
Details: ("Cannot open load file" "No such file or directory" "/home/canos/.config/emacs/.local/straight/repos/straight.el/straight.el")
Backtrace:
(require straight "/home/canos/.config/emacs/.local/straight/repos/straight.el/straight.el")
(let ((repo-dir (doom-path straight-base-dir "straight/repos/straight.el")) (repo-url (concat "http" (if gnutls-verify-error "s") "://github.com/" (or (plist-get recipe :repo) "radian-software/straight.el"))) (branch (or (plist-...
(let ((process-environment (copy-sequence process-environment))) (setenv "GIT_CONFIG" nil) (setenv "GIT_CONFIG_NOSYSTEM" "1") (setenv "GIT_CONFIG_GLOBAL" (or (getenv "DOOMGITCONFIG") "/dev/null")) (let ((repo-dir (doom-path stra...
(doom--ensure-straight (:host github :repo "radian-software/straight.el" :branch "develop" :local-repo "straight.el" :files ("straight*.el")) "56a8b6c8a46fb78655d512402ad7840d85167225")
(let* ((--cl-rest-- (alist-get 'straight packages)) (recipe (car (cdr (plist-member --cl-rest-- ':recipe)))) (pin (car (cdr (plist-member --cl-rest-- ':pin))))) (doom--ensure-straight recipe pin))
(let ((packages (doom-package-list '((:core))))) (let* ((--cl-rest-- (alist-get 'straight packages)) (recipe (car (cdr (plist-member --cl-rest-- ':recipe)))) (pin (car (cdr (plist-member --cl-rest-- ':pin))))) (doom--ensure-stra...
(progn (if doom-inhibit-log nil (doom--log "Initializing straight")) (let ((packages (doom-package-list '((:core))))) (let* ((--cl-rest-- (alist-get 'straight packages)) (recipe (car (cdr (plist-member --cl-rest-- ':recipe)))) (...
(if (or force-p (null (and (boundp 'straight-recipe-repositories) straight-recipe-repositories))) (progn (if doom-inhibit-log nil (doom--log "Initializing straight")) (let ((packages (doom-package-list '((:core))))) (let* ((--cl...
(doom-initialize-core-packages nil)
(doom-initialize-packages)
(doom-packages-install)
(if (eq install\? :no) (doom-print (doom-print--format (doom-print--class 'warn "Not installing plugins, as requested"))) (doom-print (doom-print--format "Installing plugins")) (doom-packages-install))
! Wrote extended backtrace to ~/.config/emacs/.local/state/logs/cli.doom.230623150243.15801.error
and
Cloning into '/home/canos/.config/emacs'...
^[[Aremote: Enumerating objects: 1157, done.
remote: Counting objects: 100% (1157/1157), done.
remote: Compressing objects: 100% (1048/1048), done.
remote: Total 1157 (delta 85), reused 502 (delta 66), pack-reused 0
Receiving objects: 100% (1157/1157), 1.13 MiB | 2.02 MiB/s, done.
Resolving deltas: 100% (85/85), done.
Installing Doom Emacs!
- Skipping ~/.config/doom/ (already exists)
- Skipping init.el (already exists)
- Skipping config.el (already exists)
- Skipping packages.el (already exists)
Generate an envvar file? (see `doom help env` for details) (y or n) y
> Generating envvars file
âś“ Generated ~/.config/emacs/.local/env
Installing plugins
> Installing straight...
x The package manager threw an error
x Last 16 lines of straight's error log:
$ cd /home/canos/.config/emacs/.local/straight/repos/
$ git clone --origin origin --no-checkout https\://github.com/melpa/melpa.git /home/canos/.config/emacs/.local/straight/repos/melpa/ --depth 1 --single-branch --no-tags
Cloning into '/home/canos/.config/emacs/.local/straight/repos/melpa'...
fatal: unable to access 'https://github.com/melpa/melpa.git/': Could not resolve host: github.com
[Return code: 128]
$ cd /home/canos/.config/emacs/.local/straight/repos/
$ git clone --origin origin --no-checkout https\://github.com/melpa/melpa.git /home/canos/.config/emacs/.local/straight/repos/melpa/ --no-single-branch
Cloning into '/home/canos/.config/emacs/.local/straight/repos/melpa'...
fatal: unable to access 'https://github.com/melpa/melpa.git/': Could not resolve host: github.com
[Return code: 128]
$ cd /home/canos/.config/emacs/.local/straight/repos/melpa/
$ git branch -r
[File error while Setting current directory]
Opening output file: No such file or directory, /home/canos/.config/emacs/.local/state/logs/cli.doom.230623151350.16683.error
It’s pretty obvious this is caused by some kind of connection issue to github.
Here are the most important points:
The same thing does not happen on my main pc with fedora, but it did happen when I used the nixos iso with only the command
nix-env -iA nixos.emacs
and ran the commands.
The same thing does not happen on vanilla os, which I dual boot in the laptop
I have restarted my pc several times, and tried to run the commands under my friends’ wifi, which didn’t work either
It shouldn’t have anything to do with the changes I did to my configuration since the issue is reproducible from the nixos iso
It happens in the browser too, and not just with github: There were several times where it refused to connect to reddit, for instance. However, there are also some sites where it never fails, I have yet to have a failed nixos update. It is recurrent with github though.
The issue is consistent: There hasn’t been one time where the doom install script lasted more than 10 seconds installing when it usually takes several minutes to install
As much as I hate to admit it, I have been unable to debug the issue myself, and I haven’t tried much aside from basic stuff such as disabling the firewall, especially since my knowledge of both networking and nixos are extremely shallow. I haven’t even got any clue I could investigate from. I’d like to know if anyone can replicate this issue, or has any idea of what could be causing it.
Thank you in advance
EDIT: Oddly enough, using mobile data, the process managed to run for quite a few seconds without any error. I didn’t go the whole way though, since I have a limited amount of data. Though this means that replicating the issue will be hard, I will not delete this post since this only happens with nixos. If anyone has any idea what could be happening, any and all advice would be greatly appreciated. Thanks.