diff --git a/__devshells.nix b/__devshells.nix new file mode 100644 index 0000000..4443125 --- /dev/null +++ b/__devshells.nix @@ -0,0 +1,159 @@ +{pkgs}: let + nvimCfg = import ./modules/common/nvim-cfg.nix {inherit pkgs;}; + + texlive = pkgs.texliveBasic.withPackages ( + ps: [ + ps.beamer + ps.preprint + ps.tikz-ext + ps.latexmk + ps.microtype + ps.mathtools + ps.thmtools + ps.enumitem + ps.csquotes + ps.cleveref + ps.algorithm2e + ps.ifoddpage + ps.relsize + ps.amsfonts + ps.amsmath + ps.geometry + ps.hyperref + ps.lm + ps.xcolor + ps.datetime2 + ] + ); + + latexCustomRC = '' + ${nvimCfg.baseVimConfig} + + lua << EOF + ${nvimCfg.baseLuaConfig} + + vim.g.vimtex_compiler_method = "latexmk" + + vim.g.vimtex_compiler_latexmk = { + build_dir = "", + callback = 1, + continuous = 1, + executable = "latexmk", + options = { + "-pdf", + "-interaction=nonstopmode", + "-synctex=1", + "-file-line-error", + }, + } + + vim.g.vimtex_view_method = "zathura" + vim.g.vimtex_quickfix_mode = 0 + + vim.g.plantuml_executable_script = "${pkgs.plantuml}/bin/plantuml" + + local capabilities = vim.lsp.protocol.make_client_capabilities() + + local ok_cmp_lsp, cmp_lsp = pcall(require, "cmp_nvim_lsp") + if ok_cmp_lsp then + capabilities = cmp_lsp.default_capabilities(capabilities) + end + + if vim.lsp and vim.lsp.config then + vim.lsp.config("texlab", { + cmd = { "${pkgs.texlab}/bin/texlab" }, + capabilities = capabilities, + settings = { + texlab = { + build = { + executable = "latexmk", + args = { + "-pdf", + "-interaction=nonstopmode", + "-synctex=1", + "-file-line-error", + "%f", + }, + onSave = false, + forwardSearchAfter = false, + }, + forwardSearch = { + executable = "${pkgs.zathura}/bin/zathura", + args = { + "--synctex-forward", + "%l:1:%f", + "%p", + }, + }, + }, + }, + }) + + vim.lsp.enable("texlab") + end + + vim.api.nvim_create_autocmd("FileType", { + pattern = { "tex", "plaintex", "bib" }, + callback = function() + local opts = { buffer = true } + + vim.keymap.set("n", "ll", "VimtexCompile", vim.tbl_extend("force", opts, { + desc = "LaTeX compile", + })) + + vim.keymap.set("n", "lv", "VimtexView", vim.tbl_extend("force", opts, { + desc = "LaTeX view PDF", + })) + + vim.keymap.set("n", "lc", "VimtexClean", vim.tbl_extend("force", opts, { + desc = "LaTeX clean", + })) + + vim.keymap.set("n", "lt", "VimtexTocToggle", vim.tbl_extend("force", opts, { + desc = "LaTeX TOC", + })) + end, + }) + EOF + ''; + + neovimTex = pkgs.wrapNeovim pkgs.neovim-unwrapped { + configure = { + customRC = latexCustomRC; + + packages.myNeovimPackages = { + start = + nvimCfg.basePlugins + ++ (with pkgs.vimPlugins; [ + vimtex + nvim-lspconfig + cmp-nvim-lsp + plantuml-syntax + ]); + }; + }; + }; + + nvimTex = pkgs.writeShellScriptBin "nvim-tex" '' + set -euo pipefail + exec ${neovimTex}/bin/nvim "$@" + ''; +in { + default = pkgs.mkShell { + packages = [ + nvimTex + + texlive + pkgs.texlab + pkgs.zathura + + pkgs.plantuml + pkgs.graphviz + pkgs.jre + + pkgs.git + pkgs.ripgrep + pkgs.fd + ]; + }; +} diff --git a/configuration.nix b/configuration.nix index 53c9af8..ea596e2 100644 --- a/configuration.nix +++ b/configuration.nix @@ -11,6 +11,8 @@ ./modules/common/base.nix ./modules/common/yubikey.nix ./modules/common/desktop-i3.nix + ./modules/common/terminal.nix + ./modules/common/editor.nix ./modules/common/net.nix ./modules/common/parsec.nix ./modules/common/users.nix diff --git a/devshells.nix b/devshells.nix index 17bd44a..b3eaa17 100644 --- a/devshells.nix +++ b/devshells.nix @@ -64,7 +64,15 @@ in { ps.hyperref ps.lm ps.xcolor + ps.datetime2-french ps.datetime2 + ps.llncs + + ps.ec + ps.cm-super + ps.metafont + + ps.latexindent ] )) ]; diff --git a/dotconfig/i3/config b/dotconfig/i3/config index ed360fa..0a2422b 100644 --- a/dotconfig/i3/config +++ b/dotconfig/i3/config @@ -42,7 +42,7 @@ floating_modifier $mod bindsym $mod+Shift+Q kill bindsym $mod+d exec --no-startup-id rofi -show drun -show-icons -bindsym $mod+Return exec alacritty +bindsym $mod+Return exec alacritty -e zellij bindsym $mod+Tab exec rofi -show combi -show-icons # Focus @@ -133,4 +133,4 @@ bindsym $mod+r mode "resize" ############################ # Screenshots ############################ -bindsym $mod+Shift+Print exec --no-startup-id maim --select | xclip -selection clipboard -t image/png \ No newline at end of file +bindsym $mod+Shift+Print exec --no-startup-id maim --select | xclip -selection clipboard -t image/png diff --git a/dotconfig/polybar/config.ini b/dotconfig/polybar/config.ini new file mode 100644 index 0000000..5a31801 --- /dev/null +++ b/dotconfig/polybar/config.ini @@ -0,0 +1,263 @@ +[color] +background = #2f4a36 +background-alt = #375740 +foreground = #e8e8e8 +foreground-dim = #b8c0b8 +accent = #a3be8c +alert = #ff6b6b + +; ========================= +; BASES +; ========================= + +[bar/base] +monitor = ${env:MONITOR:} +width = 100% +height = 20 +offset-x = 0 +foreground = ${color.foreground} +border-size = 0 +line-size = 0 +padding-left = 1 +padding-right = 1 +module-margin = 1 +separator = " · " +separator-foreground = ${color.foreground-dim} +font-0 = "DejaVuSansM Nerd Font Mono:size=10;2" +font-1 = "Noto Sans CJK JP:size=10;2" +font-2 = "Noto Color Emoji:size=10;2" +radius = 10 +enable-ipc = true + +[module/temp-base] +type = internal/temperature +warn-temperature = 80 +format =