mirror of
https://github.com/nix-community/nix-doom-emacs
synced 2025-08-17 13:33:37 -05:00
better configs
This commit is contained in:
@@ -33,43 +33,28 @@ The Doom configuration will be referred to as `./doom.d` in these snippets. You
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
lib,
|
||||
home-manager,
|
||||
nix-doom-emacs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
}: {
|
||||
nixosConfigurations.exampleHost = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { inherit inputs; };
|
||||
in {
|
||||
nixosConfigurations.exampleHost = lib.nixosSystem {
|
||||
inherit system specialArgs;
|
||||
modules = [
|
||||
./default.nix
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.users.exampleUser.imports = [ ./home.nix ];
|
||||
home-manager.users.exampleUser = { ... }: {
|
||||
imports = [ nix-doom-emacs.hmModule ];
|
||||
programs.doom-emacs = {
|
||||
enable = true;
|
||||
doomPrivateDir = ./doom; # Directory containing your config.el, init.el
|
||||
# and packages.el files
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
`File: home.nix`
|
||||
```nix
|
||||
{ config, pkgs, inputs, ... }: {
|
||||
imports = [ inputs.nix-doom-emacs.hmModule ];
|
||||
|
||||
# ...
|
||||
programs.doom-emacs = {
|
||||
enable = true;
|
||||
doomPrivateDir = ./doom.d; # Directory containing your config.el, init.el
|
||||
# and packages.el files
|
||||
};
|
||||
# ...
|
||||
}
|
||||
```
|
||||
|
||||
## Non-Flake Home-Manager
|
||||
@@ -92,8 +77,6 @@ in {
|
||||
|
||||
## NixOS
|
||||
|
||||
Using Nix-Doom-Emacs without Home-Manager isn't recommended, especially if you're a beginner.
|
||||
|
||||
`File: flake.nix`
|
||||
```nix
|
||||
{
|
||||
@@ -105,38 +88,26 @@ Using Nix-Doom-Emacs without Home-Manager isn't recommended, especially if you'r
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
lib,
|
||||
nix-doom-emacs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
}: {
|
||||
nixosConfigurations.exampleHost = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { inherit inputs; };
|
||||
in {
|
||||
nixosConfigurations.exampleHost = lib.nixosSystem {
|
||||
inherit system specialArgs;
|
||||
modules = [
|
||||
./default.nix
|
||||
# ...
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
`File: default.nix`
|
||||
```nix
|
||||
{ config, nixpkgs, lib, inputs }: {
|
||||
# ...
|
||||
{
|
||||
environment.systemPackages =
|
||||
let
|
||||
doom-emacs = inputs.nix-doom-emacs.packages.${system}.default.override {
|
||||
doom-emacs = inputs.nix-doom-emacs.packages.${system}.defaut.override {
|
||||
doomPrivateDir = ./doom;
|
||||
};
|
||||
in [
|
||||
doom-emacs
|
||||
];
|
||||
}
|
||||
# ...
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
@@ -144,8 +115,6 @@ For what it's worth, you can see all overridable parameters of Nix-Doom-Emacs in
|
||||
|
||||
## Standalone
|
||||
|
||||
This is the least recommended method. This uses the `devShell` (or `nix-shell` feature if you're using non-flakes, which is not recommended) feature of Nix.
|
||||
|
||||
### Flake
|
||||
|
||||
```nix
|
||||
|
@@ -7,11 +7,11 @@ 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 run `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?
|
||||
|
||||
You should use the `emacsPackagesOverlay` attribute. Here's an example that installs `magit-delta` which depends on Git:
|
||||
You should use the `emacsPackagesOverlay` attribute. Here's an example that installs `magit-delta`, which depends on Git:
|
||||
|
||||
```nix
|
||||
programs.doom-emacs = {
|
||||
|
Reference in New Issue
Block a user