From 54b9929434180caf6ed4f88d3cb044c0c18682ee Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 30 Oct 2020 00:42:44 +0000 Subject: [PATCH 1/8] niv doom-emacs: update adff1aa6 -> 57ef63d6 ## Changelog for doom-emacs: Commits: [hlissner/doom-emacs@adff1aa6...57ef63d6](https://github.com/hlissner/doom-emacs/compare/adff1aa68da379370cfd6a7605fc15c28ade52f1...57ef63d6ba8432067a2c32cca3f5ccd369d21099) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [`3d993286`](https://github.com/hlissner/doom-emacs/commit/3d993286c0fe7c68b853473e18b54fee67e5b149) Licences: Add tabstops with defaults to gpl3 * [`a110b6ab`](https://github.com/hlissner/doom-emacs/commit/a110b6ab5f9f1eecb5923e2abaea72ffe0092435) Disable idle completion in nix-mode * [`64ac1609`](https://github.com/hlissner/doom-emacs/commit/64ac1609dd729adfec653fdbdf60998945fe542e) emacs/vc: enable bug-reference-mode * [`9bbdacc7`](https://github.com/hlissner/doom-emacs/commit/9bbdacc79b85b400e65469feae1cff074053a913) Prefix tramp auto-save files * [`a6959b75`](https://github.com/hlissner/doom-emacs/commit/a6959b75f331b3e779ca257962d2eff0c5865e1d) Minor refactors & reformatting * [`e333feaf`](https://github.com/hlissner/doom-emacs/commit/e333feaf5426dd873d71e8f45f0fadff221be78e) Add mathjax support for markdown preview in pandoc * [`89019c66`](https://github.com/hlissner/doom-emacs/commit/89019c66a20482e6da7c9498b59017d5e7d21d5a) Clarify doom-store-put docstring * [`3788fd2c`](https://github.com/hlissner/doom-emacs/commit/3788fd2c449bb6bcd71e42410a2d300573abfc3a) Add Keybinding for testing all functions in the project with pytest * [`a904b718`](https://github.com/hlissner/doom-emacs/commit/a904b718f888bb94207035c6599688a05c72507e) Default to showing dotfiles in ripgrep searches * [`01922219`](https://github.com/hlissner/doom-emacs/commit/01922219811a5723458191d03e359a5e1112c8d8) Fix 'doom build' skipping straight * [`d1cef4ac`](https://github.com/hlissner/doom-emacs/commit/d1cef4ac9492278161ba3131afcd28374442b1a4) Bind SPC b {c,C} to clone buffer indirectly * [`ecddd347`](https://github.com/hlissner/doom-emacs/commit/ecddd347f37d3d71584d3ebfe428fb539231c884) lang/php: use php-language-server.php if in PATH * [`9e1ac0c0`](https://github.com/hlissner/doom-emacs/commit/9e1ac0c0be437931f35aaf03717bd5c5b19adc0b) Reduce active message-log-max; scale in debug mode * [`fe37a590`](https://github.com/hlissner/doom-emacs/commit/fe37a590cc6b9f854e53a0e3665d162b05d01cec) Set doom--initial-load-path in sandbox * [`ff3248d0`](https://github.com/hlissner/doom-emacs/commit/ff3248d0222ff6e4adce42adcc4d4b13e4164d98) Disable lsp indentation in scala mode * [`f33b1416`](https://github.com/hlissner/doom-emacs/commit/f33b141650047d0557965268f270bb750d091c98) term/eshell: fix eshell resetting eshell-mode-map * [`164b997c`](https://github.com/hlissner/doom-emacs/commit/164b997cb03294464030da065387f47beac272b7) Add q text-object for all quotes * [`e574c347`](https://github.com/hlissner/doom-emacs/commit/e574c3470d4209923fba18429952ce6067c7985f) Limit evil-textobj-anyblock to non-quotes * [`471028ce`](https://github.com/hlissner/doom-emacs/commit/471028ce94424ded969e959195007080442424bd) Bump :editor snippets * [`d21d86aa`](https://github.com/hlissner/doom-emacs/commit/d21d86aafc83284a68961a81810762065d15e8ab) Add single quotes to ‘any quote’ text objects * [`d784509a`](https://github.com/hlissner/doom-emacs/commit/d784509abf496907b92302c01446ed315f918f87) Fix hlissner/doom-emacs#4172: different build path per Emacs version * [`9ce9c683`](https://github.com/hlissner/doom-emacs/commit/9ce9c6838e5e6a7a06b3c31b1204b87390cf3b85) Add emacs version to autoloads file path * [`fd6984f2`](https://github.com/hlissner/doom-emacs/commit/fd6984f2e779162e729967662d3567aa4e0551ad) Sort which-key labels alphabetically * [`e408c045`](https://github.com/hlissner/doom-emacs/commit/e408c045485365d7ff8b34dbc3912557b546d2ae) Rebind rotate-text to ]r / [r * [`8eb8f41b`](https://github.com/hlissner/doom-emacs/commit/8eb8f41b339972c92f530e7887a2da05a737430a) EMACS28+ gate eshell keymap fix * [`1b44cf92`](https://github.com/hlissner/doom-emacs/commit/1b44cf92151c8d31fc4573d28cdf07c0c90132c8) Fix hlissner/doom-emacs#4176: eshell keybinds bound too soon * [`dbeaa8e2`](https://github.com/hlissner/doom-emacs/commit/dbeaa8e23827344e815a413f5cec50093f3fa374) Remove emacs-version check in autoloads file * [`61ec1d96`](https://github.com/hlissner/doom-emacs/commit/61ec1d96981e9d42b48b35a0a3b1a0bff3423719) mac-right-option-modifier = none * [`57ef63d6`](https://github.com/hlissner/doom-emacs/commit/57ef63d6ba8432067a2c32cca3f5ccd369d21099) Fix hlissner/doom-emacs#4176: wrong-type-arg keymapp opening eshell --- nix/sources.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nix/sources.json b/nix/sources.json index 518cd47..fd78a5f 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -5,10 +5,10 @@ "homepage": "", "owner": "hlissner", "repo": "doom-emacs", - "rev": "adff1aa68da379370cfd6a7605fc15c28ade52f1", - "sha256": "1655jhcvjjgz6gf0j8aaxvfylh81m5d86bq2x1li3q6vpd1n9j27", + "rev": "57ef63d6ba8432067a2c32cca3f5ccd369d21099", + "sha256": "1zsw33mb2j852phql6qqqd7yr41h67azy3g5603fx212lfhzai1m", "type": "tarball", - "url": "https://github.com/hlissner/doom-emacs/archive/adff1aa68da379370cfd6a7605fc15c28ade52f1.tar.gz", + "url": "https://github.com/hlissner/doom-emacs/archive/57ef63d6ba8432067a2c32cca3f5ccd369d21099.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "doom-snippets": { From 79079d1cfe9da3bf6cc72a25a8c1cc38b240c5e5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 30 Oct 2020 00:42:48 +0000 Subject: [PATCH 2/8] niv emacs-overlay: update a65baf3d -> 489f44aa ## Changelog for emacs-overlay: Commits: [nix-community/emacs-overlay@a65baf3d...489f44aa](https://github.com/nix-community/emacs-overlay/compare/a65baf3d03b54cf9282c30cbcc5895e29be84ff2...489f44aa462cea641d344e6b744296b3c07427a6) * [`cbf0b46b`](https://github.com/nix-community/emacs-overlay/commit/cbf0b46ba4a3608d837bf1d2fc7680a7acd6ca51) Updated repos/emacs * [`49a39e93`](https://github.com/nix-community/emacs-overlay/commit/49a39e9306716abde804341f68b749795afb7714) Updated repos/melpa * [`750f5399`](https://github.com/nix-community/emacs-overlay/commit/750f539993bb2508127c36df63e831aafab03ead) Updated repos/melpa * [`0b08cfc6`](https://github.com/nix-community/emacs-overlay/commit/0b08cfc6ea3957a9dac947d5cd640a010311dcb0) Updated repos/emacs * [`56f26eb7`](https://github.com/nix-community/emacs-overlay/commit/56f26eb7a3c7b4c2564b3c2738da1ab1b50770a6) Updated repos/melpa * [`9fd05c8b`](https://github.com/nix-community/emacs-overlay/commit/9fd05c8b2c839f923438f7f0165bdcd4f7e2d211) Updated repos/emacs * [`447cd6ee`](https://github.com/nix-community/emacs-overlay/commit/447cd6ee6c1d18c141f733332e12aa94a780fcb9) Updated repos/melpa * [`52a5ee88`](https://github.com/nix-community/emacs-overlay/commit/52a5ee88e2629cc17ab80c07dd93a6a6cfc42e67) Updated repos/emacs * [`3f26a309`](https://github.com/nix-community/emacs-overlay/commit/3f26a309f7f37c00285a8aa615f95e037cc1fbe5) Updated repos/melpa * [`29fd733e`](https://github.com/nix-community/emacs-overlay/commit/29fd733e27ecf10cbe350b90169e4818b81b69c5) Updated repos/emacs * [`c125c940`](https://github.com/nix-community/emacs-overlay/commit/c125c940096fbf60eeedda927db36b6e640c25f6) Updated repos/melpa * [`de7c8888`](https://github.com/nix-community/emacs-overlay/commit/de7c8888c36240a8637f58755fab333b7610f2cd) Updated repos/emacs * [`6da31097`](https://github.com/nix-community/emacs-overlay/commit/6da310975e8986f7e009b5607f6507af877a1aff) Updated repos/melpa * [`7cb85a0f`](https://github.com/nix-community/emacs-overlay/commit/7cb85a0f501201363a866bdba9416e08dd42365f) Updated repos/emacs * [`45480bb7`](https://github.com/nix-community/emacs-overlay/commit/45480bb7e0a800bf9c1d01fd6d24c811971d0bf2) Updated repos/melpa * [`7b98da90`](https://github.com/nix-community/emacs-overlay/commit/7b98da90d10f111b5ab2d42d9696ff302461a09b) Updated repos/emacs * [`ef506886`](https://github.com/nix-community/emacs-overlay/commit/ef5068862327c297b4aaf67e39bd9346859fcb99) Updated repos/melpa * [`bde129ae`](https://github.com/nix-community/emacs-overlay/commit/bde129ae906e3abfb45c6fce7c1293c0a461e715) Updated repos/emacs * [`c5926d2e`](https://github.com/nix-community/emacs-overlay/commit/c5926d2ef6e4cc0efda13962518c04aac9e208f3) Updated repos/melpa * [`d90b0d39`](https://github.com/nix-community/emacs-overlay/commit/d90b0d3964fbc8e178e3f573e55977e20da377ff) Updated repos/emacs * [`b153fa74`](https://github.com/nix-community/emacs-overlay/commit/b153fa74c36c35396c38acb8ba6d30c844356339) Updated repos/melpa * [`4a85716d`](https://github.com/nix-community/emacs-overlay/commit/4a85716decf6091a4cf7c1609db7601600c9816d) Updated repos/emacs * [`6df62227`](https://github.com/nix-community/emacs-overlay/commit/6df62227999e980e04700eb4078b7bb1d92f6db7) Updated repos/melpa * [`7c9451fb`](https://github.com/nix-community/emacs-overlay/commit/7c9451fb625f94b3d5a5123d388b7ac88d3f58dd) Updated repos/melpa * [`282243a1`](https://github.com/nix-community/emacs-overlay/commit/282243a1ed26591fb69b7601cf18736e7637b3e2) Updated repos/emacs * [`26cff72b`](https://github.com/nix-community/emacs-overlay/commit/26cff72b0c8aa021abb11c83fe883ffa0eb2ac80) Updated repos/melpa * [`dd0e2d5a`](https://github.com/nix-community/emacs-overlay/commit/dd0e2d5a490a91eb79428258bf45bc3367a0fa1f) Updated repos/emacs * [`7b5dea6b`](https://github.com/nix-community/emacs-overlay/commit/7b5dea6b1493fd3b065878364f0bfc5aa4363306) Updated repos/melpa * [`86a4826e`](https://github.com/nix-community/emacs-overlay/commit/86a4826e2e4cfaadd2b67827da1bf2f0720fbe05) Updated repos/emacs * [`862d4f21`](https://github.com/nix-community/emacs-overlay/commit/862d4f21e68c6ea1df8ed29743248ec08476205f) Updated repos/melpa * [`6ed9c212`](https://github.com/nix-community/emacs-overlay/commit/6ed9c21267ca257733312658725bc3377ccb2f08) Updated repos/emacs * [`751950ef`](https://github.com/nix-community/emacs-overlay/commit/751950efe3bed564cd37205ab05db146f011cb64) Updated repos/melpa * [`da1f4f74`](https://github.com/nix-community/emacs-overlay/commit/da1f4f7400affb377fb26da04fa7ef366f442690) Updated repos/org * [`18311057`](https://github.com/nix-community/emacs-overlay/commit/183110577003838110e05b9840e109b2089bb499) Updated repos/melpa * [`a69588a3`](https://github.com/nix-community/emacs-overlay/commit/a69588a3f7de6d68f20cea21562ab7f6f91a400a) Updated repos/melpa * [`f514da08`](https://github.com/nix-community/emacs-overlay/commit/f514da087e27289b158ebbf12e5d06df2d89a32e) Updated repos/emacs * [`6d6ada04`](https://github.com/nix-community/emacs-overlay/commit/6d6ada043dfca40b8b79573cd42d950b27729706) Updated repos/melpa * [`ccd0f77c`](https://github.com/nix-community/emacs-overlay/commit/ccd0f77c4604a68ff5bdd002e3d99e218c2c6250) Updated repos/melpa * [`6f285151`](https://github.com/nix-community/emacs-overlay/commit/6f285151e532bf1b1750afc26fef1c04aedd8259) Updated repos/melpa * [`663faccf`](https://github.com/nix-community/emacs-overlay/commit/663faccf03b1c8ffed10a4be7dd0a8511042ac30) Updated repos/melpa * [`dfac5b3c`](https://github.com/nix-community/emacs-overlay/commit/dfac5b3cede8d2580dc69ba60934cc03c07d45cb) Updated repos/melpa * [`6f4fc80f`](https://github.com/nix-community/emacs-overlay/commit/6f4fc80f3b2bbea353f4f2c7ff9ec96efff1fa56) Updated repos/emacs * [`8f30a355`](https://github.com/nix-community/emacs-overlay/commit/8f30a35561eff70de9589fd2a22bb7e52af12856) Updated repos/melpa * [`bfb566b7`](https://github.com/nix-community/emacs-overlay/commit/bfb566b71528cc388585f978f44cb6123a8372ab) Updated repos/emacs * [`14f16c29`](https://github.com/nix-community/emacs-overlay/commit/14f16c29f9c48e5de92f2a32d47dcbc62db21c4c) Updated repos/melpa * [`223b6f90`](https://github.com/nix-community/emacs-overlay/commit/223b6f90e0856187305be61da121e05e1bbe1f31) Updated repos/emacs * [`489f44aa`](https://github.com/nix-community/emacs-overlay/commit/489f44aa462cea641d344e6b744296b3c07427a6) Updated repos/melpa --- nix/sources.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nix/sources.json b/nix/sources.json index fd78a5f..26a5da9 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -29,10 +29,10 @@ "homepage": "", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "a65baf3d03b54cf9282c30cbcc5895e29be84ff2", - "sha256": "1b21b5xqqh7avhb240szhnj9d9b7ya02a8bf9pv2i2wx7dw37ikn", + "rev": "489f44aa462cea641d344e6b744296b3c07427a6", + "sha256": "1i44w1668w0wj3qsnxrfm6ln0x1cs0ljlxj6303c9jpr1mpg9fgc", "type": "tarball", - "url": "https://github.com/nix-community/emacs-overlay/archive/a65baf3d03b54cf9282c30cbcc5895e29be84ff2.tar.gz", + "url": "https://github.com/nix-community/emacs-overlay/archive/489f44aa462cea641d344e6b744296b3c07427a6.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "emacs-so-long": { From b655554890562e14b970e957f42a78a86a7533de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Vask=C3=B3?= Date: Sat, 24 Oct 2020 22:57:48 +0200 Subject: [PATCH 3/8] README.md: whitespace fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3a3a62e..174252f 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ compatible with the `doom-emacs` requirements. Using [home-manager](https://github.com/rycee/home-manager): - ``` nix +``` nix { pkgs, ... }: let From dd6819f0e01fd989bd10f126a0d79a4ecc073a31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Vask=C3=B3?= Date: Sat, 17 Oct 2020 21:47:53 +0200 Subject: [PATCH 4/8] wip: flake support --- flake.nix | 79 ++++++++++++++++++++++++++++++++++++++++ modules/home-manager.nix | 67 ++++++++++++++++++++++++++++++++++ 2 files changed, 146 insertions(+) create mode 100644 flake.nix create mode 100644 modules/home-manager.nix diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..723bed1 --- /dev/null +++ b/flake.nix @@ -0,0 +1,79 @@ +/* Usage example in flake.nix: + + { + inputs = { + home-manager.url = "github:rycee/home-manager"; + nix-doom-emacs.url = "github:vlaci/nix-doom-emacs/flake"; + doomPrivateDir.url = "/path/to/doom.d"; + doomPrivateDir.flake = false; + }; + + outputs = { + self, + nixpkgs, + home-manager, + nix-doom-emacs, + doomPrivateDir, + ... + }: { + nixosConfigurations.exampleHost = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + home-manager.nixosModules.home-manager + { + home-manager.users.exampleUser = { pkgs, ... }: { + imports = [ nix-doom-emacs.hmModule ]; + home.doom-emacs = { + enable = true; + inherit doomPrivateDir; + }; + }; + } + ]; + }; + }; + } +*/ + +{ + description = "nix-doom-emacs home-manager module"; + + inputs = { + doom-emacs.url = "github:hlissner/doom-emacs/develop"; + doom-emacs.flake = false; + doom-snippets.url = "github:hlissner/doom-snippets"; + doom-snippets.flake = false; + emacs-overlay.url = "github:nix-community/emacs-overlay"; + emacs-overlay.flake = false; + emacs-so-long.url = "github:hlissner/emacs-so-long"; + emacs-so-long.flake = false; + evil-markdown.url = "github:Somelauw/evil-markdown"; + evil-markdown.flake = false; + evil-org-mode.url = "github:hlissner/evil-org-mode"; + evil-org-mode.flake = false; + evil-quick-diff.url = "github:rgrinberg/evil-quick-diff"; + evil-quick-diff.flake = false; + explain-pause-mode.url = "github:lastquestion/explain-pause-mode"; + explain-pause-mode.flake = false; + "nix-straight.el".url = "github:vlaci/nix-straight.el/v2.1.0"; + "nix-straight.el".flake = false; + nose.url= "github:emacsattic/nose"; + nose.flake = false; + ob-racket.url = "github:xchrishawk/ob-racket"; + ob-racket.flake = false; + org-mode.url = "github:emacs-straight/org-mode"; + org-mode.flake = false; + org-yt.url = "github:TobiasZawada/org-yt"; + org-yt.flake = false; + php-extras.url = "github:arnested/php-extras"; + php-extras.flake = false; + "reveal.js".url = "github:hakimel/reveal.js"; + "reveal.js".flake = false; + "rotate-text.el".url = "github:debug-ito/rotate-text.el"; + "rotate-text.el".flake = false; + }; + + outputs = inputs: { + hmModule = import ./modules/home-manager.nix inputs; + }; +} diff --git a/modules/home-manager.nix b/modules/home-manager.nix new file mode 100644 index 0000000..ee2616e --- /dev/null +++ b/modules/home-manager.nix @@ -0,0 +1,67 @@ +{ self, ... }@inputs: +{ config, lib, pkgs, ... }: +let + cfg = config.programs.doom-emacs; + inherit (lib) literalExample mkEnableOption mkIf mkOption types; +in +{ + options.programs.doom-emacs = { + enable = mkEnableOption "Doom Emacs configuration"; + doomPrivateDir = mkOption { + description = '' + Path to your `.doom.d` directory. + + The specified directory should contain yoour `init.el`, `config.el` and + `packages.el` files. + ''; + }; + extraConfig = mkOption { + description = '' + Extra configuration options to pass to doom-emacs. + + Elisp code set here will be appended at the end of `config.el`. This + option is useful for refering `nixpkgs` derivation in Emacs without the + need to install them globally. + ''; + type = with types; lines; + default = ""; + example = literalExample '' + (setq mu4e-mu-binary = "''${pkgs.mu}/bin/mu") + ''; + }; + extraPackages = mkOption { + description = '' + Extra packages to install. + + List addition non-emacs packages here that ship elisp emacs bindings. + ''; + type = with types; listOf package; + default = [ ]; + example = literalExample "[ pkgs.mu ]"; + }; + package = mkOption { + internal = true; + }; + }; + + config = mkIf cfg.enable ( + let + emacs = pkgs.callPackage self { + extraPackages = (epkgs: cfg.extraPackages); + inherit (cfg) doomPrivateDir extraConfig; + dependencyOverrides = inputs; + }; + in + { + home.file.".emacs.d/init.el".text = '' + (load "default.el") + ''; + home.packages = with pkgs; [ + emacs-all-the-icons-fonts + ]; + programs.emacs.package = emacs; + programs.emacs.enable = true; + programs.doom-emacs.package = emacs; + } + ); +} From 9bebee33af4f36df0fff3bf3fc08157e88f6eb40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Vask=C3=B3?= Date: Sat, 17 Oct 2020 23:17:08 +0000 Subject: [PATCH 5/8] work around #62 --- flake.nix | 5 +---- modules/home-manager.nix | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 723bed1..34ccbeb 100644 --- a/flake.nix +++ b/flake.nix @@ -4,8 +4,6 @@ inputs = { home-manager.url = "github:rycee/home-manager"; nix-doom-emacs.url = "github:vlaci/nix-doom-emacs/flake"; - doomPrivateDir.url = "/path/to/doom.d"; - doomPrivateDir.flake = false; }; outputs = { @@ -13,7 +11,6 @@ nixpkgs, home-manager, nix-doom-emacs, - doomPrivateDir, ... }: { nixosConfigurations.exampleHost = nixpkgs.lib.nixosSystem { @@ -25,7 +22,7 @@ imports = [ nix-doom-emacs.hmModule ]; home.doom-emacs = { enable = true; - inherit doomPrivateDir; + doomPrivateDir = ./path/to/doom.d; }; }; } diff --git a/modules/home-manager.nix b/modules/home-manager.nix index ee2616e..e5250ff 100644 --- a/modules/home-manager.nix +++ b/modules/home-manager.nix @@ -14,6 +14,7 @@ in The specified directory should contain yoour `init.el`, `config.el` and `packages.el` files. ''; + apply = path: builtins.path { inherit path; }; }; extraConfig = mkOption { description = '' From 6c8dcd0f179cf8354266439c76de8451c1a55b3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Vask=C3=B3?= Date: Sat, 17 Oct 2020 23:24:05 +0000 Subject: [PATCH 6/8] README: adding install instructions to use flakes --- README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/README.md b/README.md index 174252f..4ce1194 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,41 @@ in { } ``` +Using `flake.nix`: + +``` nix +{ + inputs = { + home-manager.url = "github:rycee/home-manager"; + nix-doom-emacs.url = "github:vlaci/nix-doom-emacs/flake"; + }; + + outputs = { + self, + nixpkgs, + home-manager, + nix-doom-emacs, + ... + }: { + nixosConfigurations.exampleHost = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + home-manager.nixosModules.home-manager + { + home-manager.users.exampleUser = { pkgs, ... }: { + imports = [ nix-doom-emacs.hmModule ]; + home.doom-emacs = { + enable = true; + doomPrivateDir = ./doom.d; + }; + }; + } + ]; + }; + }; +} +``` + ## Under the hood This expression leverages From 4ca2366aadf27e1288cb8f20dd3886797d23c49c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Vask=C3=B3?= Date: Sat, 24 Oct 2020 23:19:45 +0200 Subject: [PATCH 7/8] hmModule: add `emacsPackage` option to make the input emacs derivation overridable. References: #78 --- modules/home-manager.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/home-manager.nix b/modules/home-manager.nix index e5250ff..e546e4b 100644 --- a/modules/home-manager.nix +++ b/modules/home-manager.nix @@ -40,6 +40,17 @@ in default = [ ]; example = literalExample "[ pkgs.mu ]"; }; + emacsPackage = mkOption { + description = '' + Emacs package to use. + + Override this if you want to use a custom emacs derivation to base + `doom-emacs` on. + ''; + type = with types; package; + default = pkgs.emacs; + example = literalExample "pkgs.emacs"; + }; package = mkOption { internal = true; }; @@ -49,6 +60,7 @@ in let emacs = pkgs.callPackage self { extraPackages = (epkgs: cfg.extraPackages); + emacsPackages = pkgs.emacsPackagesFor cfg.emacsPackage; inherit (cfg) doomPrivateDir extraConfig; dependencyOverrides = inputs; }; From 3d3d95b13b71d0eab3dbf97381601a990d639310 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Vask=C3=B3?= Date: Sun, 1 Nov 2020 09:49:50 +0100 Subject: [PATCH 8/8] hmModule: `emacsPackagesOverlay` option --- modules/home-manager.nix | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/modules/home-manager.nix b/modules/home-manager.nix index e546e4b..3f70ca3 100644 --- a/modules/home-manager.nix +++ b/modules/home-manager.nix @@ -3,6 +3,12 @@ let cfg = config.programs.doom-emacs; inherit (lib) literalExample mkEnableOption mkIf mkOption types; + overlayType = lib.mkOptionType { + name = "overlay"; + description = "Emacs packages overlay"; + check = lib.isFunction; + merge = lib.mergeOneOption; + }; in { options.programs.doom-emacs = { @@ -51,6 +57,24 @@ in default = pkgs.emacs; example = literalExample "pkgs.emacs"; }; + emacsPackagesOverlay = mkOption { + description = '' + Overlay to customize emacs (elisp) dependencies. + + As inputs are gathered dynamically, this is the only way to hook into + package customization. + ''; + type = with types; overlayType; + default = self: super: { }; + defaultText = "self: super { }"; + example = literalExample '' + self: super: { + magit-delta = super.magit-delta.overrideAttrs (esuper: { + buildInputs = esuper.buildInputs ++ [ pkgs.git ]; + }); + }; + ''; + }; package = mkOption { internal = true; }; @@ -61,7 +85,7 @@ in emacs = pkgs.callPackage self { extraPackages = (epkgs: cfg.extraPackages); emacsPackages = pkgs.emacsPackagesFor cfg.emacsPackage; - inherit (cfg) doomPrivateDir extraConfig; + inherit (cfg) doomPrivateDir extraConfig emacsPackagesOverlay; dependencyOverrides = inputs; }; in