Nixvim: Neovim Distro Powered By Nix

Sdílet
Vložit
  • čas přidán 1. 06. 2024
  • Discord server: / discord
    Donations: ko-fi.com/vimjoyer
    All code blocks from the video: github.com/vimjoyer/nixvim-video
    nixvim docs: nix-community.github.io/nixvim/
    previous nix + neovim video: • Neovim and Nix home-ma...
  • Věda a technologie

Komentáře • 81

  • @yoshiyahoo1552
    @yoshiyahoo1552 Před 4 měsíci +33

    The primagen needs to see this

  • @GaetanLepage
    @GaetanLepage Před 4 měsíci +26

    Thank you so much for presenting this project so clearly and efficiently !
    Your videos are always amazing to watch :)

  • @Chandramumta
    @Chandramumta Před 4 měsíci +12

    Hi, mighty Vimjoyer. Could you make a video about wine, bottles and other staff in NixOS? I am trying to set them up for a month now and they don`t work for me at all.

  • @aloneer0529
    @aloneer0529 Před 4 měsíci +15

    Your videos are extremely helpful! They helped me with my NixOS config!

    • @ardishco
      @ardishco Před 4 měsíci +4

      Happy to see you in the comment section Alxhr0

  • @Redyf
    @Redyf Před 4 měsíci +3

    YES, I've been making my own config for 5 days now. Nixvim is amazing, also thank you for making this video!

  • @CEOofGameDev
    @CEOofGameDev Před 4 měsíci +35

    its nix all the way down...

    • @eli1882
      @eli1882 Před 4 měsíci

      You misunderstand nix.

  • @TheMattSturgeon
    @TheMattSturgeon Před 4 měsíci +3

    Was wondering when you'd find nixvim 🎉🎉

  • @Aditya-ny8ur
    @Aditya-ny8ur Před 4 měsíci +2

    Thank you very much for the video

  • @caedis_
    @caedis_ Před 4 měsíci +1

    Any thoughts on creating a video on nixos impermanence via tmpfs as root or restoring root as an empty zfs/btrfs snapshots?

  • @_modiX
    @_modiX Před 4 měsíci +2

    I maintain my own vim configuration on top of NvChad, but oh boi, this is just magic, wow.

  • @ThibautLamadon
    @ThibautLamadon Před 4 měsíci +3

    love nixvim!

  • @JonnyIrwin
    @JonnyIrwin Před 4 měsíci +4

    Thanks for this! I recently setup my Neovim config in nixvim & while it largely works well, I’m undecided whether I want to use this or use a pure Lua config. I’ve had issues with things like getting option autocompletion working with the nixd LSP server. I’ve looked through source code and not sure if it is correct in nixvim, or my version of nixd is too old…or whether I just don’t yet know enough to set it up correctly.

    • @vimjoyer
      @vimjoyer  Před 4 měsíci +2

      Nixd is a bit hard to setup, I recommend nil_ls which mostly "just works". I'll make a video about most major nix LSPs later

    • @JonnyIrwin
      @JonnyIrwin Před 4 měsíci

      @@vimjoyer I’ve switched to nil_ls. It was just the prospect of option completion that made nixd attractive.

    • @IndigoVFX
      @IndigoVFX Před 4 měsíci +1

      @@vimjoyeryet nixd actually uses nix to evaluate and parse the code you write as opposed to sitting on top of another parser… at least that’s the way I read it when I compared, though I might be mistaken. On my NixOS setup I have it working with Helix but have yet to try it with Nixvim 🤔

  • @TheSast
    @TheSast Před 4 měsíci +2

    Is it possible to use it together with other distros (specifically the ones that are just handled as lua plugins)?

    • @vimjoyer
      @vimjoyer  Před 4 měsíci

      You can use them separately, but I don't think there's a way to integrate them together.

  • @mahmoodsagharjooghi961
    @mahmoodsagharjooghi961 Před 3 měsíci +1

    This is super interesting! Thanks! ❤❤
    I was wondering how do you make those nice code transition effects? 🤔

  • @Redyf
    @Redyf Před 4 měsíci +2

    Can you make a video about declarative disk partitioning and formatting with Disko?

  • @astronemir
    @astronemir Před 3 měsíci +1

    Awesome, thanks

  • @lennyescott
    @lennyescott Před 4 měsíci +1

    would it be possible to configure nixvim's colorscheme with nix-colors? I saw in the colorschemes "base16", so maybe it could be possible? Thanks

    • @vimjoyer
      @vimjoyer  Před 4 měsíci

      Sure, you can interpolate colors into highlight groups.

  • @Muaahaa
    @Muaahaa Před 4 měsíci +6

    I think this is a cool approach, but I prefer to keep as much in Lua as I can, except for installing plugins and their dependencies which I do in Nix. With Lua, I'm still working with codified configuration which is the important part for me, but I still get the advantage of having a more idiomatic nvim config.

    • @GekoPoiss
      @GekoPoiss Před 4 měsíci

      You can just include Lua files in your Nix config.

    • @Muaahaa
      @Muaahaa Před 4 měsíci

      ​@@GekoPoissYup, that is what I do. My neovim config can be run as a flake and isn't tied to any nix frameworks or libraries. Just some wrapNeovimUnstable neovim-unwrapped...
      The Lua is structured more or less like a standard nvim config (although I've rolled my own plugin manager that sets up plugins, but does not install them since I've got nix doing this).

    • @GekoPoiss
      @GekoPoiss Před 4 měsíci

      Nice - next step is to use a decent editor, like Emacs :) @@Muaahaa

  • @Official_R_deep
    @Official_R_deep Před 4 měsíci +3

    I'm configure neovim with nvchad. When I decide to use nixvim. I'm thing it is big mistake but after try three to five day. I'm very happy about it. But best part configuration. It come with lot of configuration. For nixos user I recommend use nixvim.

  • @kokomema
    @kokomema Před 4 měsíci +4

    It would be great to compare two interesting text editors, Emacs and Helix. Both are modular, extensible and oriented towards user customization

    • @ElGnomistico
      @ElGnomistico Před 4 měsíci +1

      Helix not so much so, it's whole motto is to be "batteries included" and to come with somewhat sensible defaults so at least for now it isn't very extensible or customizable.

    • @Redyf
      @Redyf Před 4 měsíci

      Neovim better​@@ElGnomistico

  • @slim5782
    @slim5782 Před 4 měsíci +1

    How did you get the mapleader to space? It's still bound to next character in my normal mode.

    • @vimjoyer
      @vimjoyer  Před 4 měsíci +1

      globals.mapleader = " ";
      Works in an empty setup without anything else, just tested.

    • @slim5782
      @slim5782 Před 4 měsíci

      Thanks for responding, must be me then. Have a nice day! i'll make a donation @@vimjoyer

  • @underflowexception
    @underflowexception Před 4 měsíci +2

    I've been playing with NixOS over the last day and now I want to be able to pull my dotfiles from git into the OS automatically but I don't know how... can anyone point my in the right direction?

    • @vimjoyer
      @vimjoyer  Před 4 měsíci +1

      What do you mean by automatically? You can use git clone or nixos-rebuild --flake to fetch it from GitHub.

  • @harshilbhatt1556
    @harshilbhatt1556 Před 3 měsíci +1

    How do you manage multiple flakes? Are they concatenated into 1 file or is there a better way to do this?

    • @vimjoyer
      @vimjoyer  Před 3 měsíci

      Flakes can import other flakes with web or filesystem urls, but you can include as many projects in one flake as you want. It all depends on your specific use case.

    • @harshilbhatt1556
      @harshilbhatt1556 Před 3 měsíci

      So would you run a nixvim flake for each project, or modify the "global" flake at /etc/nixos in this case

  • @hansdampf2284
    @hansdampf2284 Před 4 měsíci +2

    Can I install emacs?

  • @durhamparkour
    @durhamparkour Před 4 měsíci +1

    How do you take this flake and use it as you would the regular neovim package system wide?

    • @vimjoyer
      @vimjoyer  Před 4 měsíci

      Many ways to achieve it:
      1. Use home-manager/NixOS module
      2. Add this flake as an input to your flake and take default package from there
      3. Just copy the output part from this flake into your home-manager/NixOS flake systemPackages

    • @pmmeurcatpics
      @pmmeurcatpics Před 2 měsíci

      ​@@vimjoyerI've been struggling to wrap my head around this for 2 days now.I wanted to define the nixvim configurations in a file called nixvim.nix, and then import it into home.nix. But I get a recursion error when I do that.
      My setup has these 3 notable steps:
      1) `modules = [./home.nix];` in flake.nix
      2) `import = [./nixvim.nix];` in home.nix
      3) `import = [inputs.nixHomeManagerModules.nixvim];` in nixvim.nix
      4) ..and then I hope to put the actual nixvim setup inside nixvim.nix
      Now that I think of it, in step 3, nixvim.nix calls `inputs`, which is defined in flake.nix, which in step 1 itself calls nixvim.nix (via home.nix), and I guess that's why the recursion happens. The only solution that comes to mind is to somehow re-export inputs.nixHomeManagerModules.nixvim as nixvim from inside flake.nix, so that nixvim.nix can then just use it without causing recursion, but I'm not sure if/how one can do this.
      But you somehow aren't having to do any of this in your video, and use a flake instead. What I don't understand is how you connect it to your home-manager configuration. Do somehow import that flake into home.nix somehow? Or maybe even the home-manager's flake.nix? If so, how?? I honestly have no idea anymore

  • @GeorgeGzirishvili
    @GeorgeGzirishvili Před 4 měsíci +1

    Is there an easy way to convert my existing shell customizations into Nix language syntax? I use a theme, plugins, aliases, functions, set environment variables, etc. I also try to make it portable, so it works on multiple shells, and sometimes I use loops to do multiple operations. Can I replicate this wit Nix? I know Nix is functional, not procedural.

    • @vimjoyer
      @vimjoyer  Před 4 měsíci

      Home-manager has options for all major shells, and interpolating packages into them ensures that your shell will work the same way on any OS. Managing themes and plugins with nix is also very easy.

  • @daddyDangle
    @daddyDangle Před 4 měsíci +4

    Please do a collab with @Primeagen and @TJ

  • @wiltedblackrose
    @wiltedblackrose Před 4 měsíci +3

    Sounds amazing! What about lazy loading?

    • @vimjoyer
      @vimjoyer  Před 4 měsíci +3

      There is an issue opened called "[Feature] Lazy loading", so I guess it's coming

    • @wiltedblackrose
      @wiltedblackrose Před 4 měsíci +2

      @@vimjoyer Great! Thank you!

  • @ggorg0
    @ggorg0 Před 4 měsíci +2

    Kinda late here, but I use Emacs, specifically Doom Emacs because I'm lazy. It has very crappy integration with Nix and I barely managed to get it working using nix-doom-emacs. I'm actually considering switching over to Neovim (maybe also Neovide, the GUI frontend?), but I will definitely miss some of the Emacs features, especially Org mode. I really don't wanna leave the Emacs ecosystem, but it's just too unpopular to actually be useful and receive good support. Everyone just makes plugins for VSCode nevertheless...

    • @geryz7549
      @geryz7549 Před 4 měsíci

      Neovim has lots of Org mode alternatives, most notably Neorg, although they may not have all the functionality of Emacs' Org mode

    • @trejohnson7677
      @trejohnson7677 Před 4 měsíci

      if it makes u feel better getting prety much anything except software-you-write to work on nix is a fucking pain.

  • @grawlixes
    @grawlixes Před 3 měsíci +1

    What if I want to install and configure nixvim entirely from my home-manager?

    • @vimjoyer
      @vimjoyer  Před 3 měsíci +1

      Use home-manager module and configure everything with `nixvim = {}` option

    • @grawlixes
      @grawlixes Před 3 měsíci

      Thank you, loving the vids @@vimjoyer

    • @karlwalter666
      @karlwalter666 Před 2 měsíci

      @@vimjoyerHow exactly would you go on about this solution? I'm using flakes and declaring home-manager module in my flake.nix, but I struggle to make the nixvim option visible in home.nix.

  • @0xCAFEF00D
    @0xCAFEF00D Před 4 měsíci +3

    Sorry to bring some negativity.
    But I don't see the point. The video doesn't quite make the case for nixvim and would be greatly helped by an introduction explaining the core ideas.
    From this presentation it seems a marginal difference to just default neovim configuration with lazy. You have your lazy.lua with a plugin list (identified by string rather than plugins.plugin.enable like here). Plugins often require you to run a setup. Frequently just a require and a setup function call with no argument. Which you could do with the config field in lazy, it's just a very tiny difference. The *_potential_* benefit I do see is that nix might provide defaults for supported plugins that may lack them. It might resolve keymapping conflicts or overall have a system of keymapping structuring that makes it maximally consistent for whatever plugins you might use together. But that's not presented here. That would be incredibly useful for someone who wants defaults as much as possible.
    You set options in a very similar way, vim.o.shiftwidth=4, just not declared in a table. Of course neovim options aren't just in .o, so clearly this is good if they're now sensibly unified.
    I find the lsp config presentation most confusing. It would be one thing if just that server list with .enable was required and it creates nice sensible defaults for you with literally no config on your part or only exposing a set of rebinding options. In line with the key mappings idea.
    But you've replicated the lsp_config example config on github within a difference of maybe 5-10 lines. And you've obfuscated control. With lsp_config it's perfectly clear. It uses vim primitives like autocmd which will be used elsewhere in almost any config.
    The benefit is just so marginal.
    Maybe the big benefit isn't mentioned. Maybe the person who made nixvim absolutely loves declarative configuration and this is for those people. That's good. But from my perspective it's not that different.

    • @vimjoyer
      @vimjoyer  Před 4 měsíci +1

      I agree with you on some points, but the difference between using lspconfig and nixvim is that nixvim I also installs lsp servers for you. It's more comparable to Mason, minus installing dependencies like npm. Nixvim ensures that your setup will work on every machine.

    • @0xCAFEF00D
      @0xCAFEF00D Před 4 měsíci +1

      ​@@vimjoyer You're right, I forget I have mason becuase I don't have to touch it. Which to me doesn't make it that important to abstract away. OS support is a big plus. I would guess that newer neovim users are more likely to have to use windows some of the time.

  • @adjbutler
    @adjbutler Před 2 měsíci +1

    Nixvim > lazy

  • @ivanjermakov
    @ivanjermakov Před 4 měsíci +1

    So Nixvim maintainers need to support configuration of every plugin in existence? Does not sound sustainable.

    • @ivanjermakov
      @ivanjermakov Před 4 měsíci +2

      I checked the source code and they really have flake configuration for every plugin they support, some of them are over 500 loc long...

    • @GaetanLepage
      @GaetanLepage Před 4 měsíci

      I have a fairly low amount of sleep time.

    • @sachinchaudhary1310
      @sachinchaudhary1310 Před měsícem

      @@GaetanLepage sad

    • @GaetanLepage
      @GaetanLepage Před měsícem

      More seriously, we are shifting to adopting the "settings" convention from RFC-42 for the plugins. This is much more sensible and sustainable.

    • @sachinchaudhary1310
      @sachinchaudhary1310 Před měsícem

      @@GaetanLepage means u don't have to make those settings thing ? user can do normally ?

  • @mzakyr42
    @mzakyr42 Před 4 měsíci +1

    is somoene make a package manager using brainf**k i don't know how to make it

    • @vimjoyer
      @vimjoyer  Před 4 měsíci

      Make a brainf**k to nix transpiler 🧠

    • @mzakyr42
      @mzakyr42 Před 4 měsíci

      @@vimjoyer somoene proably makes a brainf**k compiler in nix maybe somoene could do it.

  • @ujulspins
    @ujulspins Před 2 hodinami +1

    What the actual fuck