Nixvim: Neovim Distro Powered By Nix

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ก.ย. 2024

ความคิดเห็น • 90

  • @yoshiyahoo1552
    @yoshiyahoo1552 8 หลายเดือนก่อน +50

    The primagen needs to see this

    • @sachinchaudhary1310
      @sachinchaudhary1310 3 หลายเดือนก่อน +1

      he did

    • @IamPyu-v
      @IamPyu-v 3 หลายเดือนก่อน

      @@sachinchaudhary1310 Not before this the comment your replying to ;-;

    • @sachinchaudhary1310
      @sachinchaudhary1310 3 หลายเดือนก่อน

      @@IamPyu-v i know

  • @GaetanLepage
    @GaetanLepage 8 หลายเดือนก่อน +27

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

  • @aloneer0529
    @aloneer0529 8 หลายเดือนก่อน +15

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

    • @ardishco
      @ardishco 8 หลายเดือนก่อน +4

      Happy to see you in the comment section Alxhr0

  • @Chandramumta
    @Chandramumta 8 หลายเดือนก่อน +18

    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.

  • @Redyf
    @Redyf 8 หลายเดือนก่อน +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 8 หลายเดือนก่อน +41

    its nix all the way down...

    • @eli1882
      @eli1882 8 หลายเดือนก่อน

      You misunderstand nix.

  • @Muaahaa
    @Muaahaa 8 หลายเดือนก่อน +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 8 หลายเดือนก่อน

      You can just include Lua files in your Nix config.

    • @Muaahaa
      @Muaahaa 8 หลายเดือนก่อน

      ​@@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 8 หลายเดือนก่อน

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

  • @0xCAFEF00D
    @0xCAFEF00D 8 หลายเดือนก่อน +4

    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  8 หลายเดือนก่อน +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 8 หลายเดือนก่อน +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.

  • @_modiX
    @_modiX 8 หลายเดือนก่อน +2

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

  • @TheMattSturgeon
    @TheMattSturgeon 8 หลายเดือนก่อน +4

    Was wondering when you'd find nixvim 🎉🎉

  • @Official_R_deep
    @Official_R_deep 8 หลายเดือนก่อน +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 8 หลายเดือนก่อน +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 8 หลายเดือนก่อน +2

      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 8 หลายเดือนก่อน

      Neovim better​@@ElGnomistico

  • @JonnyIrwin
    @JonnyIrwin 8 หลายเดือนก่อน +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  8 หลายเดือนก่อน +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 8 หลายเดือนก่อน

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

    • @IndigoVFX
      @IndigoVFX 8 หลายเดือนก่อน +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 🤔

  • @Redyf
    @Redyf 8 หลายเดือนก่อน +3

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

  • @natural-selection-69
    @natural-selection-69 8 หลายเดือนก่อน +2

    Thank you very much for the video

  • @klirmio21
    @klirmio21 13 วันที่ผ่านมา +1

    Damn, I really struggling with. Your example works - but does not persist. I wonder how can I make the configuration be permanent?
    Documentation is hard to follow as well (maybe it is my inexperience with NixOS)

    • @vimjoyer
      @vimjoyer  13 วันที่ผ่านมา

      You need to use the module as shown at the end of the video. If you cannot figure out something, you can join the discord server and ask any questions there.

  • @daddyDangle
    @daddyDangle 8 หลายเดือนก่อน +4

    Please do a collab with @Primeagen and @TJ

  • @ggorg0
    @ggorg0 8 หลายเดือนก่อน +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 8 หลายเดือนก่อน

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

    • @trejohnson7677
      @trejohnson7677 7 หลายเดือนก่อน

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

  • @mahmoodsagharjooghi
    @mahmoodsagharjooghi 6 หลายเดือนก่อน +1

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

    • @vimjoyer
      @vimjoyer  6 หลายเดือนก่อน +1

      software is called `motion canvas`

    • @mahmoodsagharjooghi
      @mahmoodsagharjooghi 6 หลายเดือนก่อน

      Thanks! Appreciate it! 🫶

  • @ThibautLamadon
    @ThibautLamadon 8 หลายเดือนก่อน +3

    love nixvim!

  • @laughingvampire7555
    @laughingvampire7555 2 หลายเดือนก่อน

    is there a way to just include my existing vim configuration?

  • @underflowexception
    @underflowexception 8 หลายเดือนก่อน +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  8 หลายเดือนก่อน +1

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

  • @Naton
    @Naton 4 วันที่ผ่านมา

    first you pulled a flake, then you're editing some config file. i assume home.nix?
    what if i dont want to use home-manager? very confusing...

  • @TheSast
    @TheSast 8 หลายเดือนก่อน +2

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

    • @vimjoyer
      @vimjoyer  8 หลายเดือนก่อน

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

  • @lennyescott
    @lennyescott 8 หลายเดือนก่อน +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  8 หลายเดือนก่อน

      Sure, you can interpolate colors into highlight groups.

  • @caedis_
    @caedis_ 7 หลายเดือนก่อน +1

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

  • @astronemir
    @astronemir 6 หลายเดือนก่อน +1

    Awesome, thanks

  • @GeorgeGzirishvili
    @GeorgeGzirishvili 8 หลายเดือนก่อน +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  8 หลายเดือนก่อน

      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.

  • @durhamparkour
    @durhamparkour 8 หลายเดือนก่อน +1

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

    • @vimjoyer
      @vimjoyer  8 หลายเดือนก่อน

      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 5 หลายเดือนก่อน

      ​@@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

  • @harshilbhatt1556
    @harshilbhatt1556 6 หลายเดือนก่อน +1

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

    • @vimjoyer
      @vimjoyer  6 หลายเดือนก่อน

      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 6 หลายเดือนก่อน

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

  • @hansdampf2284
    @hansdampf2284 8 หลายเดือนก่อน +3

    Can I install emacs?

  • @slim5782
    @slim5782 8 หลายเดือนก่อน +1

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

    • @vimjoyer
      @vimjoyer  8 หลายเดือนก่อน +1

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

    • @slim5782
      @slim5782 8 หลายเดือนก่อน

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

  • @grawlixes
    @grawlixes 6 หลายเดือนก่อน +1

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

    • @vimjoyer
      @vimjoyer  6 หลายเดือนก่อน +1

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

    • @grawlixes
      @grawlixes 6 หลายเดือนก่อน

      Thank you, loving the vids @@vimjoyer

    • @karlwalter666
      @karlwalter666 6 หลายเดือนก่อน

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

  • @wiltedblackrose
    @wiltedblackrose 8 หลายเดือนก่อน +3

    Sounds amazing! What about lazy loading?

    • @vimjoyer
      @vimjoyer  8 หลายเดือนก่อน +3

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

    • @wiltedblackrose
      @wiltedblackrose 8 หลายเดือนก่อน +2

      @@vimjoyer Great! Thank you!

  • @lukeE632
    @lukeE632 2 หลายเดือนก่อน +1

    Have you managed to modularize your nixvim config and keep stylix working?
    I followed a blog post from Valentin Pratz about using "inputs.nixvim.legacyPackages.x86_64-linux.makeNixvimWithModule" to allow the config to span multiple files, but stylix doesn't seem to detect and theme nixvim anymore, and I can't work out how to tell it to.

    • @vimjoyer
      @vimjoyer  2 หลายเดือนก่อน

      I prefer to have a separate theme for my editor, so I didn't connect my neovim to stylix

  • @ivanjermakov
    @ivanjermakov 8 หลายเดือนก่อน +1

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

    • @ivanjermakov
      @ivanjermakov 8 หลายเดือนก่อน +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 8 หลายเดือนก่อน

      I have a fairly low amount of sleep time.

    • @sachinchaudhary1310
      @sachinchaudhary1310 4 หลายเดือนก่อน

      @@GaetanLepage sad

    • @GaetanLepage
      @GaetanLepage 4 หลายเดือนก่อน

      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 4 หลายเดือนก่อน

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

  • @adjbutler
    @adjbutler 5 หลายเดือนก่อน +1

    Nixvim > lazy

  • @mzakyr342
    @mzakyr342 8 หลายเดือนก่อน +1

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

    • @vimjoyer
      @vimjoyer  8 หลายเดือนก่อน

      Make a brainf**k to nix transpiler 🧠

    • @mzakyr342
      @mzakyr342 8 หลายเดือนก่อน

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

  • @septuleptum
    @septuleptum 3 หลายเดือนก่อน +1

    What the actual fuck