diff --git a/README.md b/README.md index 1febe0a..487b5a1 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,31 @@ # texTemplate +This is a nix flake that can reproducible build your tex document +and configures some environments to write texfiles as nix devShells -a latex template \ No newline at end of file +## Name +There is a comment `# name to be used as indentifier for editor environments and such` +Set the `name` parameter below to something sensible. + +## Dependencies +There is a line with a comment above called `# LaTex package dependencies`. +Here you put your latex package depencies (see the `nixpkgs.texlive` for working +values. + +## devShells +There is a `default` devShell you can set it to something different right now it is kakoune. + +### kakoune +The default devShell gives you a kakoune with configured texlab lsp, and a zathura viewer +with configured auto build and forwardSearch on save. Backward search is not configured right now. +The relevant config files are completly contained in the flake, you can edit them to your liking. + +It starts kakoune as a background server. It is your job to clean it up afterwards. Also if +you want to use the fzf plugin you should be in some environment that can handle shell windows +(like kitty or tmux). And because of my old habit to start my editor as `vim` there is a alias +that you should use called `vim` to access the started kakoune session. + +### texStudio +This is what it sounds, it is a shell with texStudio available, it should autostart + +### texMaker +The same as texStudion just with texMaker diff --git a/flake.nix b/flake.nix index a12cb0e..72df471 100644 --- a/flake.nix +++ b/flake.nix @@ -52,6 +52,7 @@ let pkgs = nixpkgsFor.${system}; in ( rec { + # This sets the default devShell default = kakoune; kakoune = let @@ -107,10 +108,11 @@ pkgs.mkShellNoCC { inputsFrom = [self.outputs.packages.${system}.default]; packages = [myKakoune texlab pkgs.git pkgs.zathura pkgs.fzf]; + # TODO only try to start the kakoune session if no session with that + # name exists shellHook = '' alias ..="cd .." mkdir -p ${latexTmpDir} - touch /tmp/texlabLog export KAKOUNE_CONFIG_DIR="/dev/null/" kak -d -s ${name} & alias vim="kak -c ${name}" @@ -120,12 +122,18 @@ pkgs.mkShellNoCC { inputsFrom = [self.outputs.packages.${system}.default]; packages = [pkgs.texstudio pkgs.git]; + shellHook = '' + texstudio + ''; }; texmaker = pkgs.mkShellNoCC { inputsFrom = [self.outputs.packages.${system}.default]; packages = [pkgs.texmaker pkgs.git]; + shellHook = '' + texmaker + ''; }; }) );