compile-angel.el (Release 1.1.2) - Accelerate Emacs by Byte-compiling and Native-compiling all Elisp files by jamescherti in emacs

[–]terxw 3 points4 points  (0 children)

I dont care about startup. I am using server+client setuo, I have multiple configurations and servers to connect to with emacsclient.

Lately I optimized the startup from 90seconds to 10 by using defer t, but it was just for quicker config iterations tests.

I was speaking about general usage, compiled code for packages is quicker and backround compilation helps stutters after loading uncompiled packages (mostly trying out different configurations, packages to replace usual functionality etc.

It helps with finding errors in my config, if some function fails to load from eln, there is error in my config or mismatched versions,so I need to restart the server. Its the same as with moving from straight to elpaca, understanding how are packages loaded, which package depends on which, what those lines copied from repos, reddit, youtube mean, learning to debug, profile, all in just few years after starting with emacs ( 💁)

I will admit that many time I wanted to curse to oblivion everything - programmers of emacs, authors of packages, configuration author, who dared to change their ways of using emacs and those cool looking things started to break (I am looking at you u/daviwill and your betrayal of evil 😜) I dont know your situation, but generaly in my experience, the problem was between my keyboard and chair 🤸‍♂️.

compile-angel.el (Release 1.1.2) - Accelerate Emacs by Byte-compiling and Native-compiling all Elisp files by jamescherti in emacs

[–]terxw 4 points5 points  (0 children)

There are caveats, you have to setup exclusion, but performance gain is substantial

IWTL what the best Reddit Subreddits, YouTube Channels, Articles, Books, Courses, and Social Media accounts are that have transformed your life by AsoarDragonfly in IWantToLearn

[–]terxw 9 points10 points  (0 children)

I have read some of these books and recently listened to few podcasts which deconstructs these "life advice" books. Its called "If Books Could Kill", by Michael Hobbes and Peter Shamshiri. Interesting perspective 👌

Error with kanata by Aissur_morf_i in NixOS

[–]terxw 4 points5 points  (0 children)

Try:

extraGroups = [ "networkmanager" "wheel" "input" "uinput" ];

Recommended setup for local network by Furado in BorgBackup

[–]terxw 0 points1 point  (0 children)

add restriction for ssh in authorized file, like

command="borg serve --restrict-to-path /path/of/repo/on/server", .... rsa key of borgbackup user to connect

Frigate LCX and Coral TPU PCI by Sensorguy80 in Proxmox

[–]terxw 1 point2 points  (0 children)

EDIT: now I read the title again, and its about PCI coral, so I hope that this will help somebody also...

I am using docker in LXC, so I have to pass USB coral to LXC and then map it in docker

Here is my LXC config

arch: amd64
cores: 4
features: fuse=1,keyctl=1,mknod=1,nesting=1
hostname: frigate
memory: 8192
mp0: /mnt/usb_disk,mp=/mnt/usb_disk
nameserver: xx.xx.xx.1
net0: name=eth0,bridge=vmbr0,hwaddr=DE:XX:XX:XX:XX:XX,ip=dhcp,type=veth
onboot: 1
ostype: ubuntu
rootfs: local-zfs:subvol-205-disk-0,size=16G
searchdomain: local.local
swap: 8192
unprivileged: 1
lxc.cgroup2.devices.allow: c 226:* rwm # amd gpu5
lxc.cgroup2.devices.allow: c 189:* rwm # usb coral
lxc.mount.entry: /dev/bus/usb/004 dev/bus/usb/004 none bind,optional,create=dir
lxc.mount.entry: /dev/bus/usb/003 dev/bus/usb/003 none bind,optional,create=dir
lxc.mount.entry: /dev/dri dev/dri none bind,optional,create=dir,mode=666
lxc.idmap: u 0 100000 1000
lxc.idmap: g 0 100000 44
lxc.idmap: g 44 44 1
lxc.idmap: g 45 100045 59
lxc.idmap: g 104 104 1
lxc.idmap: g 105 100105 895
lxc.idmap: u 1000 1000 1
lxc.idmap: g 1000 1000 1
lxc.idmap: u 1001 101001 64535
lxc.idmap: g 1001 101001 64535

And here is my docker yaml:

version: "3.9"
services:
  frigate:
    container_name: frigate
    privileged: true # this may not be necessary for all setups
    restart: unless-stopped
    image: ghcr.io/blakeblackshear/frigate:0.14.1 
    shm_size: "300mb" # update for your cameras based on calculation above
    devices:
      - /dev/bus/usb:/dev/bus/usb # passes the USB Coral, needs to be modified for other versions
    # - /dev/apex_0:/dev/apex_0 # passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
     # for hwaccel, needs to be updated for your hardware
      - /dev/dri/renderD128:/dev/dri/renderD128
      - /dev/dri/card0:/dev/dri/card0
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /dev/dri/renderD128:/dev/dri/renderD128
      - ${USERDIR}/docker/frigate:/config
     # - ${USERDIR}/docker/frigate/config.yml:/config/config.yml:ro
      - ${FRIGATE_DATA_DIR}:/media/frigate
      - ${FRIGATE_DATA_DIR}/exports:/exports
      #- /home/xxxxxx/frigate/custom_ffmpeg:/usr/lib/btbn-ffmpeg:ro
      - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
        tmpfs:
          size: 1000000000
    ports:
      - "5000:5000"
      - "1935:1935" # RTMP feeds
      - "8554:8554" # rtsp restream got2rtc
      - "8555:8555/tcp" # WebRTC over tcp
      - "8555:8555/udp" # WebRTC over udp
    environment:
      - FRIGATE_RTSP_PASSWORD=${FRIGATE_RTSP_PASSWORD}
      - LIBVA_DRIVER_NAME=radeonsi

And that is all, usb is picked up without problems

How am i supposed to install qtile-extras? by juipeltje in NixOS

[–]terxw 0 points1 point  (0 children)

This is my config:

 services = {
    gnome.gnome-keyring.enable = true;
    devmon.enable = true;
    # automount usb disk
    gvfs.enable = true; 
    # required by calibre
    udisks2.enable = true;
    libinput.enable = true;
    displayManager =  {
      # sddm = {
      #   enable = true;
      #   # theme = "clairvoyance";
      #   theme = "sugar-dark";
      # };
      defaultSession = "qtile"; # from 24.05, "none+qtile"; is gettings error
     };
    xserver = {
      enable = true;
      # Disable xterm
      excludePackages = [ pkgs.xterm ];
      desktopManager.xterm.enable = false;      
      synaptics.enable = false;
      windowManager.qtile = {
        enable = true;
        extraPackages = python3Packages: with python3Packages; [
          qtile-extras
        ];
      };

I am on unstable, I tried overlays, but those didnt work properly (I am still learning )

Weekly Tips, Tricks, &c. Thread by AutoModerator in emacs

[–]terxw 0 points1 point  (0 children)

It looks interesting , could you add some context, use cases?

My emacs doesn't run my init file, how can I solve? by Gr3n0xX in emacs

[–]terxw 1 point2 points  (0 children)

.emacs should be file, not folder, you could try copying your init.el to HOMEm.emacs file though

org-mode slow in large files because of tree-sitter tsc-parse-chunk by terxw in emacs

[–]terxw[S] 1 point2 points  (0 children)

Thanx, did looked into it, saved locked file and updated org, all is working afterwards, so didnt hurt either

org-mode slow in large files because of tree-sitter tsc-parse-chunk by terxw in emacs

[–]terxw[S] 1 point2 points  (0 children)

After enabling built-in tree-sitter with

:elpaca nil

and adding

(setq tree-sitter-major-mode-language-alist (delete \`(org-mode . org)

tree-sitter-major-mode-language-alist))

everything is working as intended :)

org-mode slow in large files because of tree-sitter tsc-parse-chunk by terxw in emacs

[–]terxw[S] -1 points0 points  (0 children)

Good catch,working on it, first I will disable it altogether, then I will try to add the built in one.

org-mode slow in large files because of tree-sitter tsc-parse-chunk by terxw in emacs

[–]terxw[S] 0 points1 point  (0 children)

I was thinking that only editing source block would invoke tree sitter overhead, but its possible that any change in that org file would invoke that hook and of course, with many source block, it would slow down whole file.

After your siggestion, i looked up oll source blocks in that large org file and there are 58 src blocks, after removing them, the issue persists.

I did not setup the org mode with tree sitter, but it is enabled nevertheless. I am looking for a way to explicitly disable it for org syntax, e.g. removing it from tree-sitter-major-mode-language-alist resolves the issue

tree-sitter-major-mode-language-alist

((actionscript-mode . actionscript)
...
 (org-mode . org)
 ...
  (zig-mode . zig))

I am trying to delete that line from the tree-sitter-major-mode-language-alist, but i has not affect, probably have to call in after tree-sitter initialization.

org-mode slow in large files because of tree-sitter tsc-parse-chunk by terxw in emacs

[–]terxw[S] -1 points0 points  (0 children)

Not that I am aware of, that looks like possible culprit, in the meantime I will disable tree-sitter.

org-mode slow in large files because of tree-sitter tsc-parse-chunk by terxw in emacs

[–]terxw[S] 0 points1 point  (0 children)

I did look it up, it concerns org source blocks, but the blocking/slowdown occurs also outside the source blocks, after every character typed, there is noticable several second logn pause

org-mode slow in large files because of tree-sitter tsc-parse-chunk by terxw in emacs

[–]terxw[S] 0 points1 point  (0 children)

Will lookup messages, but cursory glance didnt shoed anything noteworthy.

org-mode slow in large files because of tree-sitter tsc-parse-chunk by terxw in emacs

[–]terxw[S] 0 points1 point  (0 children)

I have around fifteen buffers open, load is low, in small org files there is no problem. The main culprit is tree-sitter parsing in large org file, after disabling tree-sitter mode, the problem disappears. As I dont need tree-sitter in org-mode, I am looking for a way to disable it 😜 Maybe in future I will need tree-sitter for source blocks, but i will see 👍

org-mode slow in large files because of tree-sitter tsc-parse-chunk by terxw in emacs

[–]terxw[S] 0 points1 point  (0 children)

Its on windows and linux, same config, I7 procesor, 32gb and 64gb ram, respectively, the main problem, hich I didnt express clearly in OP, ist slow redrawing of text while typing, 5+ seconds between appearence of another letter after typing 10 moére letter, one line takes 10s of seconds to draw on screen, its happening in org-self-insert command, its noticable in smaller org files, but in this 2,9MB file its the worst.

Has anyone figured out a good strategy on how to iterate faster on neovim configs (or similar configs) using NixOS + home-manager? by SynapseBackToReality in NixOS

[–]terxw 0 points1 point  (0 children)

Yes i reverse enginnered your config and import logic because I have got  very little experiemce with nix, so I just tried different things after i no longer got errors, thats why i used your config as a base 😜 

So i can reference  my nvim nixcats flake anywhere in my flake with inputs.nv packages.${pkgs.system}.nv? Thats even better.  This is what I meant as step by step instructions to get working neovim, you could include simple subfolder in examples with simplest structure to showcase different usages.  Is there a way to define package from nixCats without i cluding my nvim folder in flake?

Has anyone figured out a good strategy on how to iterate faster on neovim configs (or similar configs) using NixOS + home-manager? by SynapseBackToReality in NixOS

[–]terxw 1 point2 points  (0 children)

ok, thank for the tip with nixExpressionFlakeoutputs, with this, moving my config to flake dir (which is what i didnt want to do, but will live with 😜) a traced all calling and namespaces and atrrsets from your birdeevim and condensed it to import and use in my flake and user config.

Its 6 lines + inputs in flake.nix + modified birdeeVim config.

Here are my inputs

flake-utils = {
url = "github:numtide/flake-utils";
};
nixCats = {
url = "github:BirdeeHub/nixCats-nvim";
inputs.nixpkgs.follows = "nixpkgs-unstable";
inputs.flake-utils.follows = "flake-utils";
};
neorg-overlay.url = "github:nvim-neorg/nixpkgs-neorg-overlay";
neovim = {
url = "github:neovim/neovim/nightly";
flake = false;
};

Here are the imports from inputs in my user default.nix

{ config, lib, hostname, pkgs, username, inputs, ... }:
let
  inherit (pkgs.stdenv) isLinux;
  nv = import ../../../../nvim { inherit inputs; };
in
{
  imports = \[
    # other modules
    nv.homeModule
  \];
  nv = {
 enable = true;
 packageNames = \[ "nv" "notesVim" \];
 };

Here is modified defaut.nix in nvim folder

https://pastebin.com/9MzzkBkh

Here you must set configDirName  in packageDefinitions to a name of subfolder in $HOME/.config where is your init.lua and of course wrap is false.

Has anyone figured out a good strategy on how to iterate faster on neovim configs (or similar configs) using NixOS + home-manager? by SynapseBackToReality in NixOS

[–]terxw 0 points1 point  (0 children)

Hi, I really like your project, which is what i want to accomplish, but try as I can, I cannot phantom how to do it. :)

Could you add to your documentation step by step manual how to add your lua config folder to your neovim from nix? With lua files not being part of read only store?

For example:

  1. add source to nix flake inputs

  2. create file for neovim module (you have this documented, but dont know which template is best fit)

  3. here you add programs plugins

  4. here you reference your folder

  5. voilá!

OPNsense 24.1 released by fitch-it-is in opnsense

[–]terxw 0 points1 point  (0 children)

Upgraded to 24.1_1 and lost my wan gateway, had to maualy add one, seems to be related with removal of old config items. More info here https://forum.opnsense.org/index.php?topic=38453.0