Add shortcut for opening /etc/nixos/flake.nix if present, warn otherwise
This commit is contained in:
parent
2bae5e2973
commit
82f720260b
|
@ -82,6 +82,16 @@
|
||||||
(find-file (locate-user-emacs-file "init.el")))
|
(find-file (locate-user-emacs-file "init.el")))
|
||||||
(keymap-global-set "C-c w c" #'my/open-init-file)
|
(keymap-global-set "C-c w c" #'my/open-init-file)
|
||||||
|
|
||||||
|
;; NixOS flake shortcut
|
||||||
|
(defun my/open-nixos-flake ()
|
||||||
|
"Open NixOS system config flake"
|
||||||
|
(interactive)
|
||||||
|
(let ((flake "/etc/nixos/flake.nix"))
|
||||||
|
(if (file-exists-p flake)
|
||||||
|
(find-file flake)
|
||||||
|
(warn (concat flake " not found")))))
|
||||||
|
(keymap-global-set "C-c w n" #'my/open-nixos-flake)
|
||||||
|
|
||||||
;; Scratch buffer shortcut
|
;; Scratch buffer shortcut
|
||||||
(keymap-global-set "C-c w x" #'scratch-buffer)
|
(keymap-global-set "C-c w x" #'scratch-buffer)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue