added latexmk (because texlab ignores my config) and helix
This commit is contained in:
parent
19be2c3635
commit
79baa1b95a
4 changed files with 185 additions and 110 deletions
9
.helix/config.toml
Normal file
9
.helix/config.toml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
theme = "dracula"
|
||||||
|
|
||||||
|
[editor]
|
||||||
|
text-width = 120
|
||||||
|
|
||||||
|
[editor.soft-wrap]
|
||||||
|
enable = true
|
||||||
|
wrap-at-text-width = true
|
||||||
|
|
19
.helix/languages.toml
Normal file
19
.helix/languages.toml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
# This does not work, i do not know why
|
||||||
|
# [language-server.texlab]
|
||||||
|
# command = "texlab"
|
||||||
|
# args = ["-vvv", "--log-file", "/tmp/texlabLog"]
|
||||||
|
# [language-server.texlab.config]
|
||||||
|
# build.onSave = true
|
||||||
|
# build.executable = "latexrun"
|
||||||
|
# build.args = ["--bibtex-cmd", "biber", "--latex-args","'-synctex=1'","%f"]
|
||||||
|
# build.forwardSearcAfter = true
|
||||||
|
# forwardSearch.executable = "zathura"
|
||||||
|
# forwardSearch.args = ["--synctex-forward", "%l:1:%f", "%p"]
|
||||||
|
|
||||||
|
# [language-server.ltex-ls-plus]
|
||||||
|
# command = "ltex-ls-plus"
|
||||||
|
# args = ["--log-file=", "/tmp/ltex.log"]
|
||||||
|
|
||||||
|
[[language]]
|
||||||
|
name = "latex"
|
||||||
|
language-servers = [ "texlab", "ltex-ls-plus" ]
|
260
flake.nix
260
flake.nix
|
@ -8,106 +8,144 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {self, nixpkgs} :
|
outputs =
|
||||||
let
|
{ self, nixpkgs }:
|
||||||
# name to be used as identifier for editor environments and such
|
let
|
||||||
name = "Name";
|
# name to be used as identifier for editor environments and such
|
||||||
#Generate a user-friendly version number.
|
name = "Name";
|
||||||
version = builtins.substring 0 8 self.lastModifiedDate;
|
#Generate a user-friendly version number.
|
||||||
|
version = builtins.substring 0 8 self.lastModifiedDate;
|
||||||
|
|
||||||
# System types to support.
|
# System types to support.
|
||||||
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
|
supportedSystems = [
|
||||||
|
"x86_64-linux"
|
||||||
|
"x86_64-darwin"
|
||||||
|
"aarch64-linux"
|
||||||
|
"aarch64-darwin"
|
||||||
|
];
|
||||||
|
|
||||||
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
|
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
|
||||||
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
||||||
|
|
||||||
# Nixpkgs instantiated for supported system types.
|
# Nixpkgs instantiated for supported system types.
|
||||||
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
|
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
|
||||||
|
|
||||||
|
in
|
||||||
|
{
|
||||||
|
packages = forAllSystems (
|
||||||
|
system:
|
||||||
|
let
|
||||||
|
pkgs = nixpkgsFor.${system};
|
||||||
|
# LaTex package dependencies
|
||||||
|
latexdeps = { inherit (pkgs.texlive) scheme-full; };
|
||||||
|
latex = pkgs.texlive.combine latexdeps;
|
||||||
|
latexrun = pkgs.latexrun;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
default = pkgs.stdenvNoCC.mkDerivation {
|
||||||
|
name = "output.pdf";
|
||||||
|
buildInputs = [
|
||||||
|
latex
|
||||||
|
latexrun
|
||||||
|
pkgs.biber
|
||||||
|
];
|
||||||
|
src = self;
|
||||||
|
buildPhase = ''
|
||||||
|
cd src
|
||||||
|
latexrun -o ../output.pdf Main.tex
|
||||||
|
'';
|
||||||
|
installPhase = ''
|
||||||
|
cd ..
|
||||||
|
mkdir -p $out
|
||||||
|
cp output.pdf $out/output.pdf
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
devShells = forAllSystems (
|
||||||
|
system:
|
||||||
|
let
|
||||||
|
pkgs = nixpkgsFor.${system};
|
||||||
|
in
|
||||||
|
(rec {
|
||||||
|
# This sets the default devShell
|
||||||
|
default = helix;
|
||||||
|
helix = pkgs.mkShellNoCC {
|
||||||
|
inputsFrom = [ self.outputs.packages.${system}.default ];
|
||||||
|
packages = [
|
||||||
|
pkgs.helix
|
||||||
|
pkgs.ltex-ls-plus
|
||||||
|
pkgs.texlab
|
||||||
|
pkgs.git
|
||||||
|
pkgs.zathura
|
||||||
|
pkgs.fzf
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
in {
|
kakoune =
|
||||||
packages = forAllSystems (system:
|
let
|
||||||
let
|
texlab = pkgs.callPackage (import ./texLab.nix) { };
|
||||||
pkgs = nixpkgsFor.${system};
|
latexTmpDir = "src/latex.out/";
|
||||||
# LaTex package dependencies
|
myKakoune =
|
||||||
latexdeps = {inherit (pkgs.texlive) scheme-small;};
|
let
|
||||||
latex = pkgs.texlive.combine latexdeps;
|
# this could also be done by generating toml with the
|
||||||
latexrun = pkgs.latexrun;
|
# nixpkgs lib, but I'm lazy
|
||||||
in {
|
kak-lsp-config = pkgs.writeTextFile {
|
||||||
default = pkgs.stdenvNoCC.mkDerivation {
|
name = "kak-lsp-config.toml";
|
||||||
name = "output.pdf";
|
text = ''
|
||||||
buildInputs = [latex latexrun pkgs.biber];
|
[language.latex]
|
||||||
src = self;
|
filetypes = ["latex"]
|
||||||
buildPhase = ''
|
roots = [".git"]
|
||||||
latexrun -o output.pdf src/Main.tex
|
command = "texlab"
|
||||||
'';
|
args = ["-vvvv", "--log-file", "/tmp/texlabLog"]
|
||||||
installPhase = ''
|
settings_section = "texlab"
|
||||||
mkdir -p $out
|
[language.latex.settings.texlab.build]
|
||||||
cp output.pdf $out/output.pdf
|
onSave = true
|
||||||
'';
|
executable = "latexrun"
|
||||||
};
|
args = ["--bibtex-cmd", "biber", "--latex-args", "'-synctex=1'","%f"]
|
||||||
}
|
forwardSearchAfter = true
|
||||||
);
|
[language.latex.settings.texlab.forwardSearch]
|
||||||
devShells = forAllSystems (system:
|
executable = "zathura"
|
||||||
let
|
args = ["--synctex-forward", "%l:1:%f", "%p"]
|
||||||
pkgs = nixpkgsFor.${system};
|
[language.latex.settings.texlab]
|
||||||
in ( rec {
|
auxDirectory = "${latexTmpDir}"
|
||||||
# This sets the default devShell
|
'';
|
||||||
default = kakoune;
|
};
|
||||||
kakoune =
|
config = pkgs.writeTextFile (rec {
|
||||||
let
|
name = "kakrc.kak";
|
||||||
texlab = pkgs.texlab;
|
destination = "/share/kak/autoload/${name}";
|
||||||
latexTmpDir = "src/latex.out/";
|
text = ''
|
||||||
myKakoune =
|
colorscheme solarized-dark
|
||||||
let
|
set global tabstop 2
|
||||||
# this could also be done by generating toml with the
|
set global indentwidth 2
|
||||||
# nixpkgs lib, but I'm lazy
|
# eval %sh{kak-lsp --kakoune --session $kak_session -c ${kak-lsp-config} --log /tmp/kak-lspLog -vvvv}
|
||||||
kak-lsp-config = pkgs.writeTextFile {
|
eval %sh{kak-lsp --kakoune --session $kak_session -c ${kak-lsp-config}}
|
||||||
name = "kak-lsp-config.toml";
|
hook global WinSetOption filetype=(latex) %{
|
||||||
text = ''
|
lsp-auto-hover-enable
|
||||||
[language.latex]
|
lsp-enable-window
|
||||||
filetypes = ["latex"]
|
}
|
||||||
roots = [".git"]
|
add-highlighter global/ number-lines
|
||||||
command = "texlab"
|
map global normal <c-p> ': fzf-mode<ret>'
|
||||||
# args = ["-vvvv", "--log-file", "/tmp/texlabLog"]
|
'';
|
||||||
settings_section = "texlab"
|
});
|
||||||
[language.latex.settings.texlab.build]
|
in
|
||||||
onSave = true
|
pkgs.kakoune.override {
|
||||||
executable = "latexrun"
|
plugins = with pkgs.kakounePlugins; [
|
||||||
args = ["--bibtex-cmd", "biber", "--latex-args", "'-synctex=1'","%f"]
|
fzf-kak
|
||||||
forwardSearchAfter = true
|
kakoune-lsp
|
||||||
[language.latex.settings.texlab.forwardSearch]
|
config
|
||||||
executable = "zathura"
|
];
|
||||||
args = ["--synctex-forward", "%l:1:%f", "%p"]
|
};
|
||||||
[language.latex.settings.texlab]
|
in
|
||||||
auxDirectory = "${latexTmpDir}"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
config = pkgs.writeTextFile (rec {
|
|
||||||
name = "kakrc.kak";
|
|
||||||
destination = "/share/kak/autoload/${name}";
|
|
||||||
text = ''
|
|
||||||
colorscheme solarized-dark
|
|
||||||
set global tabstop 2
|
|
||||||
set global indentwidth 2
|
|
||||||
# eval %sh{kak-lsp --kakoune --session $kak_session -c ${kak-lsp-config} --log /tmp/kak-lspLog -vvvv}
|
|
||||||
eval %sh{kak-lsp --kakoune --session $kak_session -c ${kak-lsp-config}}
|
|
||||||
hook global WinSetOption filetype=(latex) %{
|
|
||||||
lsp-auto-hover-enable
|
|
||||||
lsp-enable-window
|
|
||||||
}
|
|
||||||
add-highlighter global/ number-lines
|
|
||||||
map global normal <c-p> ': fzf-mode<ret>'
|
|
||||||
'';
|
|
||||||
});
|
|
||||||
in
|
|
||||||
pkgs.kakoune.override {
|
|
||||||
plugins = with pkgs.kakounePlugins; [fzf-kak kak-lsp config];
|
|
||||||
};
|
|
||||||
in
|
|
||||||
pkgs.mkShellNoCC {
|
pkgs.mkShellNoCC {
|
||||||
inputsFrom = [self.outputs.packages.${system}.default];
|
inputsFrom = [ self.outputs.packages.${system}.default ];
|
||||||
packages = [myKakoune texlab pkgs.git pkgs.zathura pkgs.fzf];
|
packages = [
|
||||||
|
myKakoune
|
||||||
|
texlab
|
||||||
|
pkgs.git
|
||||||
|
pkgs.zathura
|
||||||
|
pkgs.fzf
|
||||||
|
];
|
||||||
# TODO only try to start the kakoune session if no session with that
|
# TODO only try to start the kakoune session if no session with that
|
||||||
# name exists
|
# name exists
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
|
@ -117,27 +155,29 @@
|
||||||
kak -d -s ${name} &
|
kak -d -s ${name} &
|
||||||
alias vim="kak -c ${name}"
|
alias vim="kak -c ${name}"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
texstudio =
|
texstudio = pkgs.mkShellNoCC {
|
||||||
pkgs.mkShellNoCC {
|
inputsFrom = [ self.outputs.packages.${system}.default ];
|
||||||
inputsFrom = [self.outputs.packages.${system}.default];
|
packages = [
|
||||||
packages = [pkgs.texstudio pkgs.git];
|
pkgs.texstudio
|
||||||
|
pkgs.git
|
||||||
|
];
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
texstudio
|
texstudio
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
texmaker =
|
texmaker = pkgs.mkShellNoCC {
|
||||||
pkgs.mkShellNoCC {
|
inputsFrom = [ self.outputs.packages.${system}.default ];
|
||||||
inputsFrom = [self.outputs.packages.${system}.default];
|
packages = [
|
||||||
packages = [pkgs.texmaker pkgs.git];
|
pkgs.texmaker
|
||||||
|
pkgs.git
|
||||||
|
];
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
texmaker
|
texmaker
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
7
src/.latexmkrc
Normal file
7
src/.latexmkrc
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
$pdf_mode=1;
|
||||||
|
# for lualatex
|
||||||
|
# $pdf_mode=4;
|
||||||
|
$pdf_previewer="start zathura %O %S";
|
||||||
|
$pdf_update_method=2;
|
||||||
|
$pdflatex="pdflatex --shell-escape --synctex=1 %O %S";
|
||||||
|
$lualatex="lualatex --shell-escape --synctex=1 %O %S";
|
Loading…
Add table
Add a link
Reference in a new issue