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 = {
|
outputs = {
|
||||||
self,
|
self,
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
lib,
|
|
||||||
home-manager,
|
home-manager,
|
||||||
nix-doom-emacs,
|
nix-doom-emacs,
|
||||||
...
|
...
|
||||||
}:
|
}: {
|
||||||
let
|
nixosConfigurations.exampleHost = nixpkgs.lib.nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
specialArgs = { inherit inputs; };
|
|
||||||
in {
|
|
||||||
nixosConfigurations.exampleHost = lib.nixosSystem {
|
|
||||||
inherit system specialArgs;
|
|
||||||
modules = [
|
modules = [
|
||||||
./default.nix
|
|
||||||
home-manager.nixosModules.home-manager
|
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
|
## Non-Flake Home-Manager
|
||||||
@@ -92,8 +77,6 @@ in {
|
|||||||
|
|
||||||
## NixOS
|
## NixOS
|
||||||
|
|
||||||
Using Nix-Doom-Emacs without Home-Manager isn't recommended, especially if you're a beginner.
|
|
||||||
|
|
||||||
`File: flake.nix`
|
`File: flake.nix`
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
@@ -105,18 +88,22 @@ Using Nix-Doom-Emacs without Home-Manager isn't recommended, especially if you'r
|
|||||||
outputs = {
|
outputs = {
|
||||||
self,
|
self,
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
lib,
|
|
||||||
nix-doom-emacs,
|
nix-doom-emacs,
|
||||||
...
|
...
|
||||||
}:
|
}: {
|
||||||
let
|
nixosConfigurations.exampleHost = nixpkgs.lib.nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
specialArgs = { inherit inputs; };
|
|
||||||
in {
|
|
||||||
nixosConfigurations.exampleHost = lib.nixosSystem {
|
|
||||||
inherit system specialArgs;
|
|
||||||
modules = [
|
modules = [
|
||||||
./default.nix
|
{
|
||||||
|
environment.systemPackages =
|
||||||
|
let
|
||||||
|
doom-emacs = inputs.nix-doom-emacs.packages.${system}.defaut.override {
|
||||||
|
doomPrivateDir = ./doom;
|
||||||
|
};
|
||||||
|
in [
|
||||||
|
doom-emacs
|
||||||
|
];
|
||||||
|
}
|
||||||
# ...
|
# ...
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
@@ -124,28 +111,10 @@ Using Nix-Doom-Emacs without Home-Manager isn't recommended, especially if you'r
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
`File: default.nix`
|
|
||||||
```nix
|
|
||||||
{ config, nixpkgs, lib, inputs }: {
|
|
||||||
# ...
|
|
||||||
environment.systemPackages =
|
|
||||||
let
|
|
||||||
doom-emacs = inputs.nix-doom-emacs.packages.${system}.default.override {
|
|
||||||
doomPrivateDir = ./doom;
|
|
||||||
};
|
|
||||||
in [
|
|
||||||
doom-emacs
|
|
||||||
];
|
|
||||||
# ...
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
For what it's worth, you can see all overridable parameters of Nix-Doom-Emacs in [default.nix](../default.nix).
|
For what it's worth, you can see all overridable parameters of Nix-Doom-Emacs in [default.nix](../default.nix).
|
||||||
|
|
||||||
## Standalone
|
## 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
|
### Flake
|
||||||
|
|
||||||
```nix
|
```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`?
|
## 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?
|
## 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
|
```nix
|
||||||
programs.doom-emacs = {
|
programs.doom-emacs = {
|
||||||
|
Reference in New Issue
Block a user