From de3f79cae7f8044cfc7472a41a7d47cbe9095622 Mon Sep 17 00:00:00 2001 From: Antti Kaihola <13725+akaihola@users.noreply.github.com> Date: Fri, 28 Jun 2024 11:39:48 +0300 Subject: [PATCH] newbie-friendly flake & home-manager instructions --- README.md | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index c90a51f..ab9deb5 100644 --- a/README.md +++ b/README.md @@ -45,37 +45,49 @@ Please file an issue. ### With flakes -Add this flake as an input: +Add this flake as an input in `flake.nix`: ``` nix -nix-doom-emacs-unstraightened.url = "github:marienz/nix-doom-emacs-unstraightened"; -# Optional, to download less. Neither the module nor the overlay uses this input. -nix-doom-emacs-unstraightened.inputs.nixpkgs.follows = ""; +inputs = { + nix-doom-emacs-unstraightened.url = "github:marienz/nix-doom-emacs-unstraightened"; + # Optional, to download less. Neither the module nor the overlay uses this input. + nix-doom-emacs-unstraightened.inputs.nixpkgs.follows = ""; +}; ``` If your Doom configuration lives in a different repository, add that as input too: ``` nix -doom-config.url = "..."; -doom-config.flake = false; +inputs = { + doom-config.url = "..."; + doom-config.flake = false; +}; ``` #### Home Manager If you use [Home Manager](https://github.com/nix-community/home-manager), add -Unstraightened's home-manager module: +Unstraightened's home-manager module in `flake.nix`: ``` nix -imports = [ inputs.nix-doom-emacs-unstraightened.hmModule ]; +outputs = inputs @ { nixpkgs, home-manager, ... }: { + homeConfigurations."username" = home-manager.lib.homeManagerConfiguration { + modules = [ + inputs.nix-doom-emacs-unstraightened.hmModule + ./home.nix + ]; + extraSpecialArgs = { inherit inputs; }; + }; +}; ``` -Configure it: +Configure it in `home.nix`: ``` nix programs.doom-emacs = { enable = true; - doomDir = inputs.doom-config; + doomDir = inputs.doom-config; # or e.g. `./doom.d` for a local configuration }; ```