 (global-font-lock-mode t)
 (setq inhibit-splash-screen t)
 
+(defun nixfmt ()
+  "Run nixfmt on current buffer."
+  (interactive)
+  ()
+  (save-buffer)
+  (shell-command (concat "nixfmt " (buffer-file-name)))
+  (revert-buffer t t t))
+
 ;;; Post initialization
 
 (unless noninteractive

         ("C-M-n" . magit-rtm-down)
         ("C-M-p" . magit-rtm-up)))

(use-package whitespace
  :defer 5
  :bind (("C-c w" . global-whitespace-mode))

  :custom
  (nix-indent-function #'nix-indent-line))

(declare-function ivy-mode "ivy" ())
(use-package ivy
  :defer 0.1
  :diminish
  :bind (("C-c C-r" . ivy-resume)
         ("C-x B" . ivy-switch-buffer-other-window))
  :custom
  (ivy-count-format "(%d/%d) ")
  (ivy-use-virtual-buffers t)
  :config (ivy-mode))

(declare-function counsel-mode "counsel" ())
(use-package counsel
  :after ivy
  :diminish
  :config (counsel-mode))

(use-package swiper
  :after ivy
  :bind (("C-s" . swiper)
         ("C-r" . swiper)))

(use-package inf-ruby
  :hook (ruby-mode . inf-ruby-minor-mode))
