From cc00e0e74d47cbd8e182caa88c9baf17ecd64280 Mon Sep 17 00:00:00 2001 From: Swarsel Date: Thu, 11 Jul 2024 11:12:03 +0200 Subject: [PATCH] fix: make emacs-rustic use TS modes --- SwarselSystems.org | 9 +++- index.html | 94 +++++++++++++++++++++++++++++++++++++----- programs/emacs/init.el | 7 +++- 3 files changed, 97 insertions(+), 13 deletions(-) diff --git a/SwarselSystems.org b/SwarselSystems.org index eb59bec..4ab9b32 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -9777,9 +9777,16 @@ This sets up rustic-mode with tree-sitter support - there is still one issue to :init (setq rust-mode-treesitter-derive t) :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-lsp-client 'eglot) :mode ("\\.rs" . rustic-mode)) + + #+end_src *** 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++-mode c++-ts-mode - rustic-mode rust-ts-mode + rustic-mode tex-mode LaTeX-mode ) . (lambda () (progn diff --git a/index.html b/index.html index 0432aaf..38cf104 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + SwarselSystems: NixOS + Emacs Configuration @@ -369,7 +369,7 @@

Table of Contents

-This file has 40447 words spanning 10472 lines and was last revised on 2024-06-28 22:13:57 +0200. +This file has 40741 words spanning 10531 lines and was last revised on 2024-07-11 10:18:39 +0200.

@@ -419,7 +419,7 @@

1

-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)

@@ -485,7 +485,6 @@

1 -

2. Noweb-Ref blocks

@@ -2380,6 +2379,7 @@

3 firewall = { enable = true; allowedUDPPorts = [ 4380 27036 14242 34197 51820 ]; # 34197: factorio; 4380 27036 14242: barotrauma; 51820: wireguard + allowedTCPPorts = [ ]; # 34197: factorio; 4380 27036 14242: barotrauma; 51820: wireguard allowedTCPPortRanges = [ {from = 27015; to = 27030;} # barotrauma {from = 27036; to = 27037;} # barotrauma @@ -2396,8 +2396,9 @@

3 enable = 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 = { - enable = true; + enable = false; }; }; @@ -2594,13 +2595,25 @@

3 }; output = { - DP-1 = { - mode = "2560x1440"; # TEMPLATE + eDP-1 = { + mode = "1920x1080"; # TEMPLATE 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 modifier = config.wayland.windowManager.sway.config.modifier; in { @@ -5834,6 +5847,43 @@

3

+
  • Enable automatic garbage collection
    +
    +

    +The nix store fills up over time, until /boot/efi is filled. This snippet cleans it automatically on a weekly basis. +

    + +
    +
    +nix.gc = {
    +  automatic = true;
    +  randomizedDelaySec = "14m";
    +  dates = "weekly";
    +  options = "--delete-older-than 10d";
    +};
    +
    +
    +
    +
    +
  • + +
  • Enable automatic store optimisation
    +
    +

    +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. +

    + +
    +
    +nix.optimise = {
    +  automatic = true;
    +  dates = [ "weekly" ];
    +};
    +
    +
    +
    +
    +
  • Reduce systemd timeouts
    @@ -6876,6 +6926,20 @@

    3 }; }; + +

    + +

    +Also, we link some files to the users XDG configuration home: +

    + +
    +
    +xdg.configFile = {
    +  "tridactyl/tridactylrc".source = ../../programs/firefox/tridactyl/tridactylrc;
    +  "tridactyl/themes/base16-codeschool.css".source = ../../programs/firefox/tridactyl/themes/base16-codeschool.css;
    +  };
    +
     
  • @@ -7981,6 +8045,7 @@

    3 }; profiles.default = { isDefault = true; + userChrome = (builtins.readFile ../../programs/firefox/chrome/userChrome.css); extensions = with pkgs.nur.repos.rycee.firefox-addons; [ tridactyl browserpass @@ -11387,7 +11452,7 @@

    4 (add-hook 'c++-ts-mode-hook (lambda () (setq-local devdocs-current-docs '("cpp")))) -(devdocs-update-all) +; (devdocs-update-all) @@ -11706,9 +11771,16 @@

    4 :init (setq rust-mode-treesitter-derive t) :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-lsp-client 'eglot) :mode ("\\.rs" . rustic-mode)) + + @@ -11907,8 +11979,8 @@

    4 c-ts-mode c++-mode c++-ts-mode - rustic-mode rust-ts-mode + rustic-mode tex-mode LaTeX-mode ) . (lambda () (progn @@ -12550,7 +12622,7 @@

    4

    Author: Leon Schwarzäugl

    -

    Created: 2024-06-28 Fr 22:14

    +

    Created: 2024-07-11 Do 10:18

    Validate

    diff --git a/programs/emacs/init.el b/programs/emacs/init.el index eae9a4b..7bf2f3f 100644 --- a/programs/emacs/init.el +++ b/programs/emacs/init.el @@ -1288,6 +1288,11 @@ create a new one." :init (setq rust-mode-treesitter-derive t) :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-lsp-client 'eglot) :mode ("\\.rs" . rustic-mode)) @@ -1388,8 +1393,8 @@ create a new one." c-ts-mode c++-mode c++-ts-mode - rustic-mode rust-ts-mode + rustic-mode tex-mode LaTeX-mode ) . (lambda () (progn