Skip to content

Commit

Permalink
feat(emacs): add nixos-rebuild interactive command
Browse files Browse the repository at this point in the history
  • Loading branch information
gekoke committed Oct 30, 2024
1 parent 54f19ea commit 7ee55a9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/nixos/programs/emacs/init.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7ee55a9

Please sign in to comment.