fix: make emacs-rustic use TS modes

This commit is contained in:
Swarsel 2024-07-11 11:12:03 +02:00
parent 3cd390bb1c
commit cc00e0e74d
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
3 changed files with 97 additions and 13 deletions

View file

@ -9777,9 +9777,16 @@ This sets up rustic-mode with tree-sitter support - there is still one issue to
:init :init
(setq rust-mode-treesitter-derive t) (setq rust-mode-treesitter-derive t)
:config :config
(define-key rust-ts-mode-map (kbd "C-c C-c C-r") 'rustic-cargo-run)
(define-key rust-ts-mode-map (kbd "C-c C-c C-b") 'rustic-cargo-build)
(define-key rust-ts-mode-map (kbd "C-c C-c C-k") 'rustic-cargo-check)
(define-key rust-ts-mode-map (kbd "C-c C-c d") 'rustic-cargo-doc)
(define-key rust-ts-mode-map (kbd "C-c C-c a") 'rustic-cargo-add)
(setq rustic-format-on-save t) (setq rustic-format-on-save t)
(setq rustic-lsp-client 'eglot) (setq rustic-lsp-client 'eglot)
:mode ("\\.rs" . rustic-mode)) :mode ("\\.rs" . rustic-mode))
#+end_src #+end_src
*** Tramp *** Tramp
@ -9955,8 +9962,8 @@ After having tried out =lsp-mode= and =lsp-bridge= for a while each, I must say
c-ts-mode c-ts-mode
c++-mode c++-mode
c++-ts-mode c++-ts-mode
rustic-mode
rust-ts-mode rust-ts-mode
rustic-mode
tex-mode tex-mode
LaTeX-mode LaTeX-mode
) . (lambda () (progn ) . (lambda () (progn

View file

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head> <head>
<!-- 2024-06-28 Fr 22:14 --> <!-- 2024-07-11 Do 10:18 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>SwarselSystems: NixOS + Emacs Configuration</title> <title>SwarselSystems: NixOS + Emacs Configuration</title>
@ -369,7 +369,7 @@
</div> </div>
</div> </div>
<p> <p>
<b>This file has 40447 words spanning 10472 lines and was last revised on 2024-06-28 22:13:57 +0200.</b> <b>This file has 40741 words spanning 10531 lines and was last revised on 2024-07-11 10:18:39 +0200.</b>
</p> </p>
<p> <p>
@ -419,7 +419,7 @@ This section defines my Emacs configuration. For a while, I considered to use ry
</p> </p>
<p> <p>
My emacs is built using the emacs-overlay nix flake, which builds a bleeding edge emacs on wayland (pgtk) with utilities like treesitter support. By executing the below source block, the current build setting can be updated at any time, and you can see my most up-to-date build options (last updated: 2024-06-28 22:13:57 +0200) My emacs is built using the emacs-overlay nix flake, which builds a bleeding edge emacs on wayland (pgtk) with utilities like treesitter support. By executing the below source block, the current build setting can be updated at any time, and you can see my most up-to-date build options (last updated: 2024-07-11 10:18:39 +0200)
</p></li> </p></li>
</ul> </ul>
@ -485,7 +485,6 @@ window.addEventListener('load', addDarkmodeWidget);
</div> </div>
<div id="outline-container-h:d39b8dfb-536d-414f-9fc0-7d67df48cee4" class="outline-2"> <div id="outline-container-h:d39b8dfb-536d-414f-9fc0-7d67df48cee4" class="outline-2">
<h2 id="h:d39b8dfb-536d-414f-9fc0-7d67df48cee4"><span class="section-number-2">2.</span> Noweb-Ref blocks</h2> <h2 id="h:d39b8dfb-536d-414f-9fc0-7d67df48cee4"><span class="section-number-2">2.</span> Noweb-Ref blocks</h2>
<div class="outline-text-2" id="text-h:d39b8dfb-536d-414f-9fc0-7d67df48cee4"> <div class="outline-text-2" id="text-h:d39b8dfb-536d-414f-9fc0-7d67df48cee4">
@ -2380,6 +2379,7 @@ Mostly just sets some opened ports for several games, enables virtualbox (which
firewall = { firewall = {
enable = true; enable = true;
allowedUDPPorts = [ 4380 27036 14242 34197 51820 ]; # 34197: factorio; 4380 27036 14242: barotrauma; 51820: wireguard allowedUDPPorts = [ 4380 27036 14242 34197 51820 ]; # 34197: factorio; 4380 27036 14242: barotrauma; 51820: wireguard
allowedTCPPorts = [ ]; # 34197: factorio; 4380 27036 14242: barotrauma; 51820: wireguard
allowedTCPPortRanges = [ allowedTCPPortRanges = [
{from = 27015; to = 27030;} # barotrauma {from = 27015; to = 27030;} # barotrauma
{from = 27036; to = 27037;} # barotrauma {from = 27036; to = 27037;} # barotrauma
@ -2396,8 +2396,9 @@ Mostly just sets some opened ports for several games, enables virtualbox (which
enable = true; enable = true;
enableExtensionPack = true; enableExtensionPack = true;
}; };
# leaving this here for future notice. setting guest.enable = true will make 'restarting sysinit-reactivation.target' take till timeout on nixos-rebuild switch
guest = { guest = {
enable = true; enable = false;
}; };
}; };
@ -2594,13 +2595,25 @@ This is basically just adjusted to the core count, path to the <code>hwmon</code
}; };
output = { output = {
DP-1 = { eDP-1 = {
mode = "2560x1440"; # TEMPLATE mode = "1920x1080"; # TEMPLATE
scale = "1"; scale = "1";
#bg = "~/.dotfiles/wallpaper/lenovowp.png fill"; position = "1920,0";
# bg = "~/.dotfiles/wallpaper/lenovowp.png fill";
};
HDMI-A-1 = {
mode = "2560x1440";
scale = "1";
# bg = "~/.dotfiles/wallpaper/lenovowp.png fill";
position = "0,0";
}; };
}; };
workspaceOutputAssign = [
{ output = "eDP-1"; workspace = "1:一";}
{ output = "HDMI-A-1"; workspace = "2:二";}
];
keybindings = let keybindings = let
modifier = config.wayland.windowManager.sway.config.modifier; modifier = config.wayland.windowManager.sway.config.modifier;
in { in {
@ -5834,6 +5847,43 @@ security.polkit.enable = true;
</div> </div>
</li> </li>
<li><a id="org7bcef3e"></a>Enable automatic garbage collection<br />
<div class="outline-text-5" id="text-3-2-1-8">
<p>
The nix store fills up over time, until <code>/boot/efi</code> is filled. This snippet cleans it automatically on a weekly basis.
</p>
<div class="org-src-container">
<pre class="src src-nix">
nix.gc = {
automatic = true;
randomizedDelaySec = "14m";
dates = "weekly";
options = "--delete-older-than 10d";
};
</pre>
</div>
</div>
</li>
<li><a id="org2d696f5"></a>Enable automatic store optimisation<br />
<div class="outline-text-5" id="text-3-2-1-9">
<p>
This enables hardlinking identical files in the nix store, to save on disk space. I have read this incurs a significant I/O overhead, I need to keep an eye on this.
</p>
<div class="org-src-container">
<pre class="src src-nix">
nix.optimise = {
automatic = true;
dates = [ "weekly" ];
};
</pre>
</div>
</div>
</li>
<li><a id="h:12858442-c129-4aa1-9c9c-a0916e36b302"></a>Reduce systemd timeouts<br /> <li><a id="h:12858442-c129-4aa1-9c9c-a0916e36b302"></a>Reduce systemd timeouts<br />
<div class="outline-text-5" id="text-h:12858442-c129-4aa1-9c9c-a0916e36b302"> <div class="outline-text-5" id="text-h:12858442-c129-4aa1-9c9c-a0916e36b302">
@ -6876,6 +6926,20 @@ home.file = {
}; };
}; };
</pre>
</div>
<p>
Also, we link some files to the users XDG configuration home:
</p>
<div class="org-src-container">
<pre class="src src-nix">
xdg.configFile = {
"tridactyl/tridactylrc".source = ../../programs/firefox/tridactyl/tridactylrc;
"tridactyl/themes/base16-codeschool.css".source = ../../programs/firefox/tridactyl/themes/base16-codeschool.css;
};
</pre> </pre>
</div> </div>
</div> </div>
@ -7981,6 +8045,7 @@ programs.firefox = {
}; };
profiles.default = { profiles.default = {
isDefault = true; isDefault = true;
userChrome = (builtins.readFile ../../programs/firefox/chrome/userChrome.css);
extensions = with pkgs.nur.repos.rycee.firefox-addons; [ extensions = with pkgs.nur.repos.rycee.firefox-addons; [
tridactyl tridactyl
browserpass browserpass
@ -11387,7 +11452,7 @@ To install a documentation, use the <code>devdocs=install</code> command and sel
(add-hook 'c++-ts-mode-hook (add-hook 'c++-ts-mode-hook
(lambda () (setq-local devdocs-current-docs '("cpp")))) (lambda () (setq-local devdocs-current-docs '("cpp"))))
(devdocs-update-all) ; (devdocs-update-all)
</pre> </pre>
</div> </div>
@ -11706,9 +11771,16 @@ This sets up rustic-mode with tree-sitter support - there is still one issue to
:init :init
(setq rust-mode-treesitter-derive t) (setq rust-mode-treesitter-derive t)
:config :config
(define-key rust-ts-mode-map (kbd "C-c C-c C-r") 'rustic-cargo-run)
(define-key rust-ts-mode-map (kbd "C-c C-c C-b") 'rustic-cargo-build)
(define-key rust-ts-mode-map (kbd "C-c C-c C-k") 'rustic-cargo-check)
(define-key rust-ts-mode-map (kbd "C-c C-c d") 'rustic-cargo-doc)
(define-key rust-ts-mode-map (kbd "C-c C-c a") 'rustic-cargo-add)
(setq rustic-format-on-save t) (setq rustic-format-on-save t)
(setq rustic-lsp-client 'eglot) (setq rustic-lsp-client 'eglot)
:mode ("\\.rs" . rustic-mode)) :mode ("\\.rs" . rustic-mode))
</pre> </pre>
</div> </div>
</div> </div>
@ -11907,8 +11979,8 @@ After having tried out <code>lsp-mode</code> and <code>lsp-bridge</code> for a w
c-ts-mode c-ts-mode
c++-mode c++-mode
c++-ts-mode c++-ts-mode
rustic-mode
rust-ts-mode rust-ts-mode
rustic-mode
tex-mode tex-mode
LaTeX-mode LaTeX-mode
) . (lambda () (progn ) . (lambda () (progn
@ -12550,7 +12622,7 @@ This sets up the <code>dashboard</code>, which is really quite useless. But, it
</div> </div>
<div id="postamble" class="status"> <div id="postamble" class="status">
<p class="author">Author: Leon Schwarzäugl</p> <p class="author">Author: Leon Schwarzäugl</p>
<p class="date">Created: 2024-06-28 Fr 22:14</p> <p class="date">Created: 2024-07-11 Do 10:18</p>
<p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p> <p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
</div> </div>
</body> </body>

View file

@ -1288,6 +1288,11 @@ create a new one."
:init :init
(setq rust-mode-treesitter-derive t) (setq rust-mode-treesitter-derive t)
:config :config
(define-key rust-ts-mode-map (kbd "C-c C-c C-r") 'rustic-cargo-run)
(define-key rust-ts-mode-map (kbd "C-c C-c C-b") 'rustic-cargo-build)
(define-key rust-ts-mode-map (kbd "C-c C-c C-k") 'rustic-cargo-check)
(define-key rust-ts-mode-map (kbd "C-c C-c d") 'rustic-cargo-doc)
(define-key rust-ts-mode-map (kbd "C-c C-c a") 'rustic-cargo-add)
(setq rustic-format-on-save t) (setq rustic-format-on-save t)
(setq rustic-lsp-client 'eglot) (setq rustic-lsp-client 'eglot)
:mode ("\\.rs" . rustic-mode)) :mode ("\\.rs" . rustic-mode))
@ -1388,8 +1393,8 @@ create a new one."
c-ts-mode c-ts-mode
c++-mode c++-mode
c++-ts-mode c++-ts-mode
rustic-mode
rust-ts-mode rust-ts-mode
rustic-mode
tex-mode tex-mode
LaTeX-mode LaTeX-mode
) . (lambda () (progn ) . (lambda () (progn