Switch nix formatter and lsp

Change formatter alejandra -> nixfmt (new official formatter)
Change LSP nil -> nixd for more features
This commit is contained in:
Evie Litherland-Smith 2024-07-30 15:04:58 +01:00
parent 4f98a8cd93
commit 3e357cbe95

View file

@ -3,8 +3,9 @@
pkgs, pkgs,
fonts, fonts,
... ...
}: { }:
imports = [../shell/default.nix]; {
imports = [ ../shell/default.nix ];
services.emacs = { services.emacs = {
enable = true; enable = true;
package = config.programs.emacs.finalPackage; package = config.programs.emacs.finalPackage;
@ -18,7 +19,8 @@
# git clone https://git.xenia.me.uk/pixelifytica/emacs.git ~/.emacs.d # git clone https://git.xenia.me.uk/pixelifytica/emacs.git ~/.emacs.d
enable = true; enable = true;
package = pkgs.emacs29-pgtk; package = pkgs.emacs29-pgtk;
extraConfig = let extraConfig =
let
fixed-font-family = "${fonts.monospace.name}"; fixed-font-family = "${fonts.monospace.name}";
variable-font-family = "${fonts.sansSerif.name}"; variable-font-family = "${fonts.sansSerif.name}";
font-height = builtins.toString (builtins.floor (builtins.mul fonts.sizes.applications 10)); font-height = builtins.toString (builtins.floor (builtins.mul fonts.sizes.applications 10));
@ -45,12 +47,17 @@
''; '';
}; };
custom-theme-hash = builtins.hashFile "sha256" "${custom-theme}/${custom-theme-name}-theme.el"; custom-theme-hash = builtins.hashFile "sha256" "${custom-theme}/${custom-theme-name}-theme.el";
in '' in
''
(add-to-list 'custom-theme-load-path "${custom-theme}") (add-to-list 'custom-theme-load-path "${custom-theme}")
(add-to-list 'custom-safe-themes "${custom-theme-hash}") (add-to-list 'custom-safe-themes "${custom-theme-hash}")
(load-theme '${custom-theme-name}) (load-theme '${custom-theme-name})
''; '';
extraPackages = epkgs: with epkgs; [treesit-grammars.with-all-grammars mu4e]; extraPackages =
epkgs: with epkgs; [
treesit-grammars.with-all-grammars
mu4e
];
}; };
home.packages = with pkgs; [ home.packages = with pkgs; [
# Emacs requirements # Emacs requirements
@ -68,8 +75,18 @@
mp3info mp3info
# Customised LaTeX install # Customised LaTeX install
(texlive.combine (texlive.combine {
{inherit (pkgs.texlive) scheme-medium dvisvgm dvipng wrapfig amsmath ulem hyperref capt-of;}) inherit (texlive)
scheme-medium
dvisvgm
dvipng
wrapfig
amsmath
ulem
hyperref
capt-of
;
})
# Development tools # Development tools
## Code screenshots ## Code screenshots
@ -86,20 +103,19 @@
nodePackages.eslint nodePackages.eslint
## Formatters ## Formatters
alejandra nixfmt-rfc-style
shfmt shfmt
stylua stylua
nodePackages.prettier nodePackages.prettier
## Language servers ## Language servers
nil # Nix lsp nixd
lua-language-server lua-language-server
nodePackages.typescript-language-server nodePackages.typescript-language-server
## Interpreters ## Interpreters
(python3.withPackages (python3.withPackages (
(ps: ps: with ps; [
with ps; [
tkinter tkinter
python-lsp-server python-lsp-server
mypy mypy
@ -107,9 +123,9 @@
scipy scipy
xarray xarray
matplotlib matplotlib
])) ]
(luajit.withPackages ))
(ps: [(ps.callPackage ./luarocks/scilua.nix {})])) (luajit.withPackages (ps: [ (ps.callPackage ./luarocks/scilua.nix { }) ]))
]; ];
xdg.configFile = { xdg.configFile = {
"ruff/pyproject.toml".source = ./ruff.toml; "ruff/pyproject.toml".source = ./ruff.toml;