Spyke

Posts

Is it possible to have Hyprland's config hot-reload _and_ plugins?

My current NixOS setup uses Hyprland's NixOS module and a symlinked config.lua which allows me to preserve Hyprland's instant hot-reloading when I tweak its config.

I'm now trying to install Hyprland plugins which seems to require home-manager. I can't get it to work without needing to do a rebuild with home-manager whenever I tweak something. Has anyone managed to acheive that? Is there some way to install Hyprland plugins without home-manager? Or is there some other workaround?

View original on lemmy.ml
2

I regularly end up on the unofficial NixOS wiki (https://nixos.wiki) instead of the official one (https://wiki.nixos.org) when doing web searches. Today I to proomted out this little bookmarklet that

I regularly end up on the unofficial NixOS wiki (https://nixos.wiki/) instead of the official one (https://wiki.nixos.org/) when doing web searches. Today I to proomted out this little bookmarklet that takes me from the unofficial to the official one:

javascript:(function(){window.location.href=window.location.href.replace('nixos.wiki','wiki.nixos.org');})()

A bookmarklet is a web browser bookmark that runs JavaScript instead of navigating you to a website. To use it, create a new bookmark in your web browser and paste the snippet above into the URL field. whenever you click the bookmark it will run the code.

Btw, I was trying to find a way to set something up that does this forwarding automatically for me but couldn't find one that doesn't involve installing a browser extension. If anyone knows how to do it "natively", please let me know.

View original on lemmy.ml
4
sweden·Swedenbymawkler

Hur kan det fortfarande vara lagligt att röka på altan/balkong i radhus?

Jag bad precis en tantgranne på altanen bredvid att sluta röka och det gick verkligen inte att få henne att förstå. Min 1 år gamla dotter vill leka på altanen, men grannen sitter och kedjeröker hela dagarna. Jag var saklig och vädjande men det var som att prata med en barnslig vägg.

"Din dotter kanske inte ska vara på altanen då"

"Det finns så mycket som är farligt i världen"

"Andra grannar röker ju också"

"Det är inte olagligt"

"Gå härifrån"

Efter ett tag blev hennes gubbe hotfull mot mig och då gick jag.

Har försökt prata med hyresvärden, men de tänker inte göra någonting. Vad mer kan jag ens göra? Jag är så rasande och frustrerad just nu.

View original on lemmy.ml
14
nix·Nix / NixOSbymawkler

Why is Nix/home-manager so slow?

Sorry if this is an ignorant question. I love Nix, but as a user it feels absurd that changing an option from true to false in a home-manager managed config file that then gets transpiled from Nix to TOML, for instance, takes like 10 seconds on a decently modern machine.

In my world that kind of transpilation should be instant. I get that there's more happening behind the scenes than just doing Nix -> TOML, but still. Imagine if the transpilation of config files were instant, so you could have home-manager automagically do the transpilation every time you save the file. That would be awesome, especially for programs that support hot-reloading like Hyprland or Niri.

Is this a Nix issue or a home-manager issue? How much of speedup would it yield to rewrite Nix and/or home-manager in a faster language like Zig or Rust?

View original on lemmy.ml
13
nix·Nix / NixOSbymawkler

What's the best way to install LLM agent skill files with Nix?

Skills are basically markdown documents providing documentation/instructions for LLMs.

As an example, I would like to have a "Nix/NixOS skill" available to opencode when I'm in my NixOS configuration directory. For example one from agentskills.io . What's the best way to install that with Nix?

There seem to be some non-Nix tools for doing this, like skills.

I did some searching online but I couldn't find a simple solution to this.

View original on lemmy.ml
-3
nix·Nix / NixOSbymawkler

Nix ignoring untracked files is even more ridiculous with jj

I've always hated the fact that Nix silently ignores any file that's not tracked by Git. Partly because I always forget this and have to re-build every time that I add a new file. But also the fact that Nix is coupled to VCS.

jj is a new VCS that wraps git. jj has a slightly different (improved) workflow, and doesn't have a staging area. What this means for Nix is that whenever I create a new file I have to run jj status (the equivalent to git status) before I can build with Nix, which feels incredibly silly to me.

Thanks for coming to my Ted talk.

View original on lemmy.ml
9
rust·Rust Programmingbymawkler

What do I do after running `cargo audit`?

So I ran cargo audit on a project and got the following output:

error: 4 vulnerabilities found!
warning: 8 allowed warnings found

What do I do to fix these errors? The vulnerabilities are in dependencies of my dependencies, and they seem to be using an older version of a package. Is my only option to upgrade my own dependencies (which would take a non-trivial amount of work), or is there any way to tell my dependencies to use a newer version of those vulnerable packages like how npm audit fix works? I'm guessing that's what cargo audit fix is supposed to do, but in my case it wasn't able to fix any of the vulnerabilities.

I tried searching the web, but there was surprisingly little information on this stuff.

View original on lemmy.ml
12
neovim·Neovimbymawkler

New plugin jsx-element.nvim: JSX/TSX text-objects and motions

Hi! I built this small plugin that adds JSX/TSX text-objects and motions using Treesitter: jsx-element.nvim. I was surprised that it (to my knowledge) doesn't exist yet.

From the README:

Use ]t/[t to go to the next/previous JSX/TSX element.

Use it/at to use JSX/TSX elements as text-objects. For example dit for "delete inside tag". This works with self-closing elements:

<Checkbox value="checkedA" />
          ╰───── it ─────╯
╰─────────── at ────────────╯

It also works with paired elements:

<Button variant="text">This is a button</Button>
                       ╰───── it ─────╯
╰───────────────────── at ─────────────────────╯
New plugin jsx-element.nvim: JSX/TSX text-objects and motionshttps://github.com/mawkler/jsx-element.nvimOpen linkView original on lemmy.ml
7
neovim·Neovimbymawkler

TIL about o_CTRL-V

I've been using Neovim for about eight years, but I knever knew about :help o_CTRL-V until today. It lets you perform a command over a column.

I had the code below and wanted to remove all trailing colons:

foo:
bar:
baz:
faz:

What I meant to do was to do was (with the cursor on the first line) $<C-v>3jd to visually select all colons and then delete them. But I accidentally did $d<C-v>3j, which, to my surprise, did the same thing.

I did know about :help o_V, which lets you turn a characterwise operation like di{ into a line-wise one by doing dVi{. But it never occurred to me that I could do the same thing with <C-v>.

View original on lemmy.ml
16
neovim·Neovimbymawkler

I've gotten my work to pay a "Neovim subscription" for two years

I posted about this on Reddit a year ago, and I figured write about it again:

Like most companies, the one I work for will happilly pay for any employee's license to a proprietary IDE without batting an eye. Therefore, I argued that I should be able to spend that budget on a donation to an open source tool that I use daily instead. After a lot of back and forth I finally got them to donate an amount that would correspond to what they would pay for a yearly subscription to a proprietary tool to Neovim.

Do you use Neovim at work? If so, I urge you to do the same thing! That way the core team can continue to deliver awesome new features to the editor we all love. Here's a link to where you can donate.

I now got my work to pay a $400 yearly "Neovim subscription" for the second time.

To those wondering how I did it, I basically just argued that since employees at my work have an allocated budget for buying proprietary tools, it makes sense if we could spend an equivalent amount on a FOSS alternative. That way the money spent would benefit us all, and since we use the tool to make money we have a responsibility to give back to the FOSS project.

There was a bit of a back-and forth for technical reasons because (at least in Sweden where I live), payments and donations are handled and regulated differently, but they finally made it work.

If you also use Neovim for work, I encourage you to do the same thing! That way the core team can continue to deliver awesome new features to the editor we all love. Here's a link to where you can donate. There's also the official merch store if you would like to support the project that way: https://store.neovim.io/.

View original on lemmy.ml
364
neovim·Neovimbymawkler

New plugin: refjump.nvim - jump to next/previous LSP reference with ]r/[r

Hi! I've created refjump.nvim which is a plugin that lets you use ]r/[r to jump to the next/previous LSP reference in the current buffer for the item under the cursor.

The plugin also automatically integrates with demicolon.nvim if you have it installed, which I recently posted about. This means that you can also repeat the jumps forward/backward with ;/,.

Here's a video showing it in action.

Enjoy!

New plugin: refjump.nvim - jump to next/previous LSP reference with ]r/[rhttps://github.com/mawkler/refjump.nvimOpen linkView original on lemmy.ml
21
neovim·Neovimbymawkler

PSA: demicolon.nvim now lets you create custom keymaps

demicolon.nvim is a plugin that lets you use ;/, to repeat more jumps than just t/T/f/F like diagnostic jumps with ]d/[d and treesitter text-object jumps like ]f/[f to next/previous function.

Now you can also easily make your own custom jumps repeatable with ;/,. For example, I've now made gitsigns.nvim's ]c/[c repeatable out of the box with demicolon.nvim. Here's the implementation if you're curious. For more information see the custom jumps section in the README.

PSA: demicolon.nvim now lets you create custom keymapshttps://github.com/mawkler/demicolon.nvimOpen linkView original on lemmy.ml
15
neovim·Neovimbymawkler

Is there a solution to duplicated snippets yet?

When using LuaSnip together with nvim-cmp and a snippet library like friendly-snippets or luasnip-snippets you get a lot of duplicated snippets. That's because the language server also servers snippets. Also, you might want to create your own custom snippet that happens to share the name of a snippet that already exists.

For example, with the setup mention above, let's say that I also have a custom fn snippet for Rust files. When I type fn, nvim-cmp suggests three snippets: one from rust-analyzer, one from friendly-snippets and my custom one.

The solution to overriding friendly-snippets with your custom ones suggested in this open LuaSnip issue is to create your own fork of friendly-snippets. However, this is not ideal because it adds a lot of extra work to each user to ensure that their fork is up-to-date with upstream. Also, it doesn't solve the issue with language servers serving snippets with the same name. I know that for most language servers you can disable snippets, but that doesn't really solve the issue either because you might want some of those snippets.

What I would like is the option to only see one of the snippets listed if there are multiple ones with the same name. Which one would be controlled with a priority list, for example:

  1. If there's a custom user snippet, use that
  2. Otherwise, if there's an LSP snippet, use that
  3. Otherwise, use the one from friendly-snippets

Is this possible to achieve today?

View original on lemmy.ml
13
neovim·Neovimbymawkler

demicolon.nvim: overload ; and , keys to also repeat jumps to diagnostics and text-objects

Hi everyone! I've created a new Neovim plugin: demicolon.nvim. It lets you use ; and , keys to not only repeat t/T/f/F motions, but also to repeat diagnostic motions like ]w (jump to next warning) as well as jumps to nvim-treesitter-textobjects like ]f (jump to next function).

Video previewing it in action.

That's all. Have a great day!

demicolon.nvim: overload ; and , keys to also repeat jumps to diagnostics and text-objectshttps://github.com/mawkler/demicolon.nvimOpen linkView original on lemmy.ml
15
rust·Rust Programmingbymawkler

I've created a CLI tool to download Rust web books as EPUB

cross-posted from: https://lemmy.ml/post/17090149

Hi! I've created a CLI tool for downloading Rust web books (like The Rust Programming Language) as EPUB, so that you can easily read them on your e-book reader. The tool is heavily based on this gist and a lot of proompting.

Check it out here: https://github.com/mawkler/rust-book-to-epub

I've created a CLI tool to download Rust web books as EPUBhttps://github.com/mawkler/rust-book-to-epubOpen linkView original on lemmy.ml
21
neovim·Neovimbymawkler

PSA: modicator.nvim now has lualine.nvim support out of the box

Hi! My plugin modicator.nvim now has support for lualine.nvim out of the box.

Modicator is a plugin that changes the color of the cursor's line number based on the Vim mode, just like statusline plugins like lualine do.

The lualine integration only gets loaded if the plugin gets detected, so it should have no effect on your startup time.

PSA: modicator.nvim now has lualine.nvim support out of the boxhttps://github.com/mawkler/modicator.nvimOpen linkView original on lemmy.ml
16