From 95e62d852529ed3d800917e7bf1e5b80beb27d2e Mon Sep 17 00:00:00 2001 From: ChUrl Date: Sun, 7 Aug 2022 20:27:36 +0200 Subject: [PATCH] update emacs --- home/modules/emacs.nix | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/home/modules/emacs.nix b/home/modules/emacs.nix index 2ef64ea5..e28d8370 100644 --- a/home/modules/emacs.nix +++ b/home/modules/emacs.nix @@ -28,11 +28,17 @@ in { description = "Use the Doom Emacs framework"; }; - autosync = mkOption { + autoSync = mkOption { type = types.bool; default = false; description = "Sync Doom Emacs on nixos-rebuild"; }; + + autoUpgrade = mkOption { + type = types.bool; + default = false; + description = "Automatically upgrade Doom Emacs on nixos-rebuild"; + }; }; # Config is the merged set of all module configurations @@ -99,12 +105,19 @@ in { ''; }) - (mkIf (cfg.useDoom && cfg.autosync) { + (mkIf (cfg.useDoom && cfg.autoSync) { syncDoomEmacs = hm.dag.entryAfter [ "writeBoundary" "linkDoomConfig" ] '' ${config.home.homeDirectory}/.emacs.d/bin/doom sync ''; }) + + (mkIf (cfg.useDoom && cfg.autoUpgrade) { + + upgradeDoomEmacs = hm.dag.entryAfter [ "writeBoundary" "linkDoomConfig" ] '' + ${config.home.homeDirectory}/.emacs.d/bin/doom upgrade -! + ''; + }) ]); }; }