Skip to content

Commit 853109c

Browse files
committed
Fix hook, major mode remap
1 parent f6dc370 commit 853109c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/common/home-manager/languages/nix/default.nix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,17 @@ in
4040

4141
nix-mode = {
4242
enable = true;
43+
init = ''
44+
(add-to-list 'major-mode-remap-alist '(nix-mode . nix-ts-mode))
45+
'';
4346
bindLocal.nix-mode-map = {
4447
"C-c C-z" = "nix-repl-show";
4548
};
4649
};
4750

4851
nix-ts-mode = {
4952
enable = true;
50-
init = ''
51-
(add-to-list 'major-mode-remap-alist '(nix-mode . nix-ts-mode))
52-
'';
53-
hook = [ ''(setq format-all-formatters '(("Nix" nixfmt)))'' ];
53+
hook = [ ''(nix-ts-mode . (lambda () (setq format-all-formatters '(("Nix" nixfmt)))))'' ];
5454
command = [ "nix-ts-mode" ];
5555
bindLocal.nix-ts-mode-map = {
5656
"C-c C-z" = "nix-repl-show";

0 commit comments

Comments
 (0)