diff --git a/modules/nixos/programs/emacs/init.el b/modules/nixos/programs/emacs/init.el index 4fd8f48e..0b6e701e 100644 --- a/modules/nixos/programs/emacs/init.el +++ b/modules/nixos/programs/emacs/init.el @@ -829,6 +829,16 @@ :mode "\\.nix\\'" :hook (nix-ts-mode . lsp-deferred)) + +(defun gg/nixos-rebuild-switch () + "Run `nixos-rebuild` asynchronously." + (interactive) + (add-to-list 'display-buffer-alist '("*nixos-rebuild*" display-buffer-no-window (nil))) + (async-shell-command "nixos-rebuild switch --use-remote-sudo" "*nixos-rebuild*" "*nixos-rebuild: error")) + +(gg/leader + "n r" #'gg/nixos-rebuild-switch) + (use-package lsp-pyright :hook (python-ts-mode . (lambda () (require 'lsp-pyright)