nix-doom-emacs isn't Nix-Doom-Emacs

This commit is contained in:
Mon Aaraj
2022-09-13 00:55:20 +03:00
parent 9f5910542f
commit c3fc23c8ed
3 changed files with 15 additions and 15 deletions

View File

@@ -7,7 +7,7 @@ Nope! Doom Emacs is still perfectly usable imperatively. In fact, the very autho
## OK, I put your snippets into my NixOS configuration, and I put my Doom Emacs configuration as well. How do I `doom sync`?
To update your Doom Emacs config, you simply rebuild your configuration. For example, in NixOS you can use `nixos-rebuild switch` (or `home-manager switch` if you use Home-Manager standalone). Nix-Doom-Emacs will do everything else for you.
To update your Doom Emacs config, you simply rebuild your configuration. For example, in NixOS you can use `nixos-rebuild switch` (or `home-manager switch` if you use Home-Manager standalone). nix-doom-emacs will do everything else for you.
## How do I install my favourite package?
@@ -97,7 +97,7 @@ idris2-repl.el:29:2: Error: Cannot open load file: No such file or directory, pr
The way to fix it is by just adding the dependency it's complaining about.
Though, not all packages will complain very clearly about missing dependencies or really any issue. The best way to know how to get around this is to know how to debug Nix packages and derivations. Tools like `nix build`, `nix repl`, and `nix log` are your friend. Especially if you want to debug another person's configuration, or your own Nix-Doom-Emacs configuration without needing to `nixos-rebuild` it, then `nix build` is very useful.
Though, not all packages will complain very clearly about missing dependencies or really any issue. The best way to know how to get around this is to know how to debug Nix packages and derivations. Tools like `nix build`, `nix repl`, and `nix log` are your friend. Especially if you want to debug another person's configuration, or your own nix-doom-emacs configuration without needing to `nixos-rebuild` it, then `nix build` is very useful.
For an example, if a person is using Home-Manager+NixOS, then you can build their configuration via `nix build $CONFIG_PATH_HERE#nixosConfigurations.nixos.config.home-manager.users.$USER_HERE.programs.doom-emacs.package`. You need to replace `$CONFIG_PATH_HERE` with the path (like `.` if it's in the current directory), and `$USER_HERE` with the user. This could fail, and if it does, it'll tell you to use the `nix log` command to look at the full log. This will be important.
@@ -122,7 +122,7 @@ You can now run `emacsclient -c` to connect to the daemon.
## What is `trivialBuild`?
Though beyond the scope of this document, [`trivialBuild`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/emacs/trivial.nix) is a Nixpkgs function to trivially build Emacs packages. You can use it to build e.g. local packages or packages hosted on Git repositories. It is not a Nix-Doom-Emacs tool. It's also in a family of functions in Nixpkgs which are made to build Emacs packages. Such as:
Though beyond the scope of this document, [`trivialBuild`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/emacs/trivial.nix) is a Nixpkgs function to trivially build Emacs packages. You can use it to build e.g. local packages or packages hosted on Git repositories. It is not a nix-doom-emacs tool. It's also in a family of functions in Nixpkgs which are made to build Emacs packages. Such as:
[`generic`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/emacs/generic.nix): This is the "base" function which all the other build functions are derived from.
@@ -130,15 +130,15 @@ Though beyond the scope of this document, [`trivialBuild`](https://github.com/Ni
For what it's worth, this will not be the last time you muddle around in the Nixpkgs code to understand how to use something. The NixOS project is known to have very bad documentation, and unfortunately the code may be your only way to understand some things.
## Help! Nix-Doom-Emacs isn't working if I set DOOMDIR or EMACSDIR
## Help! nix-doom-emacs isn't working if I set DOOMDIR or EMACSDIR
You shouldn't do that. The only thing that Nix-Doom-Emacs writes in your $HOME is `~/.emacs.d/init.el`, which points to the Nix store. Make sure to remove them from your configuration, then reboot after rebuilding it. If for just the session, you can just `unset` those 2 variables.
You shouldn't do that. The only thing that nix-doom-emacs writes in your $HOME is `~/.emacs.d/init.el`, which points to the Nix store. Make sure to remove them from your configuration, then reboot after rebuilding it. If for just the session, you can just `unset` those 2 variables.
## Help! on MacOS, it says "Too many files open"!
Running `ulimit -S -n 2048` will fix it for the duration of your shell session.
## How do I use emacs-overlay's emacs with Nix-Doom-Emacs?
## How do I use emacs-overlay's emacs with nix-doom-emacs?
This is very simple. you just use the `emacsPackage` attribute after applying `emacs-overlay` to your Nixpkgs. something like: