Nix and NeoVim

Поделиться
HTML-код
  • Опубликовано: 17 фев 2024
  • Recorded live on twitch, GET IN
    / theprimeagen
    Become a backend engineer. Its my favorite site
    boot.dev/?promo=PRIMEYT
    This is also the best way to support me is to support yourself becoming a better backend engineer.
    MY MAIN YT CHANNEL: Has well edited engineering videos
    / theprimeagen
    Discord
    / discord
    Have something for me to read or react to?: / theprimeagenreact
    Kinesis Advantage 360: bit.ly/Prime-Kinesis
    Hey I am sponsored by Turso, an edge database. I think they are pretty neet. Give them a try for free and if you want you can get a decent amount off (the free tier is the best (better than planetscale or any other))
    turso.tech/deeznuts
  • НаукаНаука

Комментарии • 292

  • @GaetanLepage
    @GaetanLepage 2 месяца назад +390

    Hi !
    Thanks Prime for reacting !
    Maintainer of Nixvim here (the guy from the Neovim conf).
    About the exrpessiveness of the nixvim config, you can embed raw lua code basically anywhere.
    Btw, Prime, whenever you want co-stream to port your own config to nixvim (maybe with TheAltF4). I would be glad to help you get a first introduction to Nix.
    Thanks for everything Prime, you rock :)

    • @alexthotse5487
      @alexthotse5487 2 месяца назад +3

      LET'S GOOOOOOO!!!!!!

    • @juangajardo4054
      @juangajardo4054 2 месяца назад +2

      Would love to see something like this!
      🔥

    • @mats852
      @mats852 2 месяца назад +1

      I'd totally watch that!

    • @aimpizza6823
      @aimpizza6823 2 месяца назад +1

      that'd be awesome

    • @karim6514
      @karim6514 2 месяца назад +1

      I couldn't imagine how nixvim was so easy to work with but please add lazy loading support it looks is kinda slow if you maie fully working nixvim

  • @TheD3adlysin
    @TheD3adlysin 2 месяца назад +420

    👉👈 gotta admit guys... I'm a little nix curious uwu

    • @ardishco
      @ardishco 2 месяца назад +11

      then use it fam

    • @Redyf
      @Redyf 2 месяца назад +9

      W, join the nix hype!

    • @AdroSlice
      @AdroSlice 2 месяца назад +16

      I agree, but it feels too much like academic whiteboard masturbation

    • @darianmorat
      @darianmorat 2 месяца назад +1

      ​@@AdroSlice wtf

    • @rasib101
      @rasib101 2 месяца назад +1

      ​@@AdroSlicefor me the config is daunting

  • @vimjoyer
    @vimjoyer 2 месяца назад +189

    OMG! Thanks Prime!!!

    • @ricardoislasruiz3186
      @ricardoislasruiz3186 2 месяца назад +7

      You have an awesome channel!

    • @maksymperepelytsia6032
      @maksymperepelytsia6032 2 месяца назад +6

      Друже, маєш реально файні відео! І нового підписника)

  • @Muaahaa
    @Muaahaa 2 месяца назад +61

    Nix arc would be tops. If you hop between multiple computers and want to keep a common set of packages and configuration across all of them then Nix is the best tool I've seen for this job.

  • @maninalift
    @maninalift 2 месяца назад +74

    Honestly i think NixOS would suit ThePrimeagen really well.
    He has three discipline to keep it simple and not get distracted by crafting the perfect nix abstractions.
    On the other hand it gives you the advantage of a configuration that didn't change unless you change it. No more reading through arch Linux news to see why your upgrade isn't working. And a vast package repo - no more waiting for AUR builds and getting errors because they are never kept up to date. And if you do want to build a package differently to the standard repo, you can do it through the same nix configuration and your builds will update with your system.
    The downside is that now and then there is stuff that isn't packaged for nix and nix is so different to normal Linux that it can be a lot of work to get it to run.

    • @Edlavvalde
      @Edlavvalde 2 месяца назад +11

      nixpkgs has more than 80k packages. Nixpkgs' mkDerivation has wide support for build tools so most of the time packaging is a "it just works TM" experience.
      I think the non-FHS (ELF patching) issues are the worst offenders.

    • @enderger5308
      @enderger5308 2 месяца назад +1

      @@EdlavvaldeShudders in Electron packaging

    • @Edlavvalde
      @Edlavvalde 2 месяца назад

      @@enderger5308 😥🎻

    • @creativecraving
      @creativecraving 2 месяца назад +5

      I keep wanting to get into Nix, but every time I see a video about it, it seems so abstract that I can't evaluate whether it would meet my goals. This one is pretty concrete (thankfully) but since I'm just now learning NeoVim, I need to learn the Lua way to configure it before I try this out, which could take a few years.

    • @joewell6435
      @joewell6435 Месяц назад

      most of the issues with NixOS come down to the immutability/FHS non-compliance, there's usally ways to get stuff working, and if all else fails, or if you ivneed a quick and dirty solution you can use something like distrobox to get a mutable, FHS compliant system that integrates nicely into the host system, but of course there's always going to be edge cases that just won't work for a given user's workflow.

  • @MilitaryCoverUp
    @MilitaryCoverUp 2 месяца назад +10

    man really made the video 13:37 and thought nobody would notice

  • @nafuranyleniwiec5885
    @nafuranyleniwiec5885 2 месяца назад +18

    Nix and NixOS are truly impressive. You can declare configurations once and reuse them across various Linux distributions with minimal and quick adjustments. By pinning all dependencies, you ensure consistency. If you leverage flakes, you can seamlessly combine different stable and unstable releases of packages in one config. Working with flakes and direnv feels like magic - just navigate to the directory, and voila! All declared dependencies are linked to your PATH. Each project can even have different versions of a given package.
    While the power of Nix is evident, configuring it can be challenging. Not because the Nix language is hard to understand or unreadable, but due to the lack of comprehensive documentation and the fact that Nix is not very mainstream. Consequently, "ready solutions" for problems are not always available.

    • @ZombieLincoln666
      @ZombieLincoln666 2 месяца назад

      Seems like it’s kind of overkill for normal individual users.

    • @wojtekkrupski8583
      @wojtekkrupski8583 Месяц назад +2

      @@ZombieLincoln666Who is "normal user"? As programmer I'd say that nix make my work easier. For me, the need to manually configure each machine I work on, or debugging whether an error that “suddenly appeared” in the code does not result from something changing in dependencies like a Docker image or one of the libraries - these are "overkills" for me. Why the hell should I do it if I can use Nix with all its other superpowers?
      Even if I’m not a "normal user", I still believe that a person with a single PC would benefit from the philosophy of "configure once for entire life", a vast number of stable packages (even in the "unstable" channel), and smaller perks such as hassle-free configuration of Nvidia with Wayland

    • @ZombieLincoln666
      @ZombieLincoln666 Месяц назад

      @@wojtekkrupski8583 normal users only have one or maybe two machines. I also think it’s valuable for people to ‘refresh’ their install / configuration because chances are there is newer software that is of interest. Maybe not for you, but my setup is kind of always evolving

  • @fsouza
    @fsouza 2 месяца назад +29

    Comparing nix to arch is like comparing Haskell to C 😂

    • @red13emerald
      @red13emerald 2 месяца назад +6

      Huh, that is actually a pretty good comparison.

    • @linked3
      @linked3 Месяц назад

      The comparison is indeed very fitting. Even though both provide an extensive and always up to date repository of packages, one is highly unstable and unsafe (especially the AUR), whilst the other is very stable and literally unbreakable. Funnily enough, Nix is also a purely functional programming language and that's why NixOS is called the purely functional OS by some.

    • @kelvinpina3392
      @kelvinpina3392 8 дней назад

      it is actually good, because it is comparing different approaches, when people think about imperative they think about c, and functional haskell

  • @Muaahaa
    @Muaahaa 2 месяца назад +26

    There are ways to lean into or out from "double configuration" in Nix. Some of it can be necessary or at least advantageous because of how PATH is handled on a Nix-based system, but you have a lot of control. With my Nix dotfiles I generally opt to keep my non-nix configurations in their normal filetypes, and just use Nix to copy them to the correct place in my file system.

    • @GamerMeiogordo
      @GamerMeiogordo 2 месяца назад +1

      Do you have some examples? I'd love to do the same myself, at least until I get into home-manager and such, just copying my pre-nixos dotfiles

    • @Muaahaa
      @Muaahaa 2 месяца назад

      ​@@GamerMeiogordoI use home-manager for copying dotfiles to `~/.config`. I personally advise people to start using home-manager sooner than later.

  • @haariger_wookie5646
    @haariger_wookie5646 2 месяца назад +10

    “It’s all in the docs” The issue with nix documentation is that it is not written for a user. It assumes you are already very familiar with nix. This isn’t helped that it is all over the place and seems to not have a consensus on best practices.
    The Docs were one of the two points that drove me away from nix/nixos. With a system that does things so drastically different to “standard” Linux you have to have solid documentation for users.

  • @sharperguy
    @sharperguy 2 месяца назад +3

    The big advantage for me of doing it this way is how it integrates with my overall nixos setup. I have a single repo which defines the configuration for several machines, and this allows me not only to pull in all plugins and configurations automatically when I add a new system, without even having to specially take care of neovim itself, but also to just override specific parts of it on certain systems if needed, without having to maintain several versions of the overall neovim config.

  • @user-nq9vh7mv7k
    @user-nq9vh7mv7k 2 месяца назад +3

    Ive always struggled hard with prebuilt neovim distributions. After trying out nixvim, I got to an amazing neovim setup that just feels right and better than everything I've ever used within a day. The configuration is so extrmely straightforward and simple. Nix and NixOS are truly prime.

  • @Kabbone
    @Kabbone 2 месяца назад +11

    Actually you don't necessarily double configure, often you could also just passt the config file directly.
    But the advantage I see of the abstraction is you could hide more than one config behind an option e.g. reverse proxy for a webservice or you could keep the naming if there is a slight change in config like sometimes different capitalization

  • @joshualetcher4743
    @joshualetcher4743 2 месяца назад +2

    I really appreciate that you even include them listing their sponsors

  • @WHYUNODYLAN
    @WHYUNODYLAN 2 месяца назад +5

    I'm wholly opposed to Nix-lang configurations. Just revision control your dot files in the same directory as your .nix files and you'll have a lot less to worry about in the long run.

  • @user-xd5gd4pc9h
    @user-xd5gd4pc9h 2 месяца назад +6

    Personal setting up about this. Neovim config based on lazyvim in lua and through xdg to port them to nix. I also use nix/homemanger instead of nixos to just make it work with less frustration. For anyone who is in the same shoe. And I love prime!

  • @michelnielsen2855
    @michelnielsen2855 2 месяца назад +4

    Lol, I just spend some time this week to redo my whole Neovim setup because it was old and I wanted to switch from packer to lazy. However, I am a NixOs user. Wish I had heard about NixVim earlier, but I am probably gonna stick with my lua setup for now.
    I can highly recommend Nix and NixOs though. All other operating systems seems like stone age tools compared to NixOs.
    I will not even consider using an operating system if it does not have following features:
    - declarative reproducible configuration which is easy to copy over to a fresh laptop and get that fresh laptop rolling with all my usual setup. (I don't want to sit and manually `sudo apt-get install` all my favorite tools and packages, I just want to fire off one command and have my system setup as I use to)
    - easy rollback of upgrades when some update screw something up.
    - the ability to have the same stuff (libraries etc) installed in multiple versions, such that I never have to worry about breaking something random just because I upgraded spotify or whatever.

  • @janAkaliKilo
    @janAkaliKilo 2 месяца назад +24

    5:35 Yeah, I completely agree. All the configuration in one line arguments sound nice until you have to do something non-trivial for which there's no "one-line toggle" yet. And if you dare to look under the hood of these "config machines" to fix a couple parts - it's almost always 10x more complex than if you'd set up everything manually. Same thing applies for other (n)vim distributions, not only nixvim.

    • @dustee2680
      @dustee2680 2 месяца назад +2

      The source of the "one-line toggle" as you call it, is usually just a short preset of things you normally do in traditional linux anyway (shell script that creates some directory with permissions, systemd service with some flags, maybe creation of some user or group, etc...). If that module doesnt exist yet then you fall back to the knowledge you would need in a traditional linux anyway and write that module for yourself. Nix syntax should not scare you away, its quite simple and doesnt obstruct you in any way, quite the opposite. When something non-trivial comes up, the difficulty of it doesnt change based on if you are on nix or not.

    • @oserodal2702
      @oserodal2702 2 месяца назад +9

      You can literally import your lua config in your nixvim config.

  • @XxZeldaxXXxLinkxX
    @XxZeldaxXXxLinkxX 2 месяца назад +3

    Nix vim seems neat, but it seems most suiting for people that just want to get their feet wet.
    As prime said, it's an abstraction on top of and abstraction. Using the neovim provided by nix (home-manager) provides a perfect level of abstraction. You just add the plug-ins you want. The config that you want to add you can do in both your choice of Lua and vim script.
    One of my favorite things is you can bundle config with a plug-in, so specific config lines are only added if the plugin it's bundled with is installed.

    • @ppen9u1n
      @ppen9u1n 2 месяца назад +1

      I'd argue it's the other way around. If you use Nix(OS), your goal is to configure your system declaratively. That means that any standalone "package managers" (including those for neovim) are undesirable. The argument "I don't want to worry about plugins I don't want" is based on a misconception, nixvim comes with an empty config per default, and since nix is lazily evaluated, only things that you configure explicitly will end up in your neovim instance. And what's nice is that it's not an all-or-nothing proposition, you can add lua snippets for plugins or options that are not (yet) supported by nixvim. And you can leverage nix config merging behaviour to define global keymaps related to plugins in the same nix file that configures the plugin, so it will only be in effect when you actually import that file in your higher level config. (This allows for experimentation and "switching on/off" config features easily, for your complete system config).

  • @Qohist
    @Qohist 2 месяца назад +36

    Personally i use NixOS as a daily driver and i love it sometimes its pain in the ass but the features are just too good

    • @Redyf
      @Redyf 2 месяца назад +1

      Agreed, I have no problems with my nvidia drivers in NixOS due to atomic updates. Also even if it breaks after an update, just rollback 😄

    • @_Lumiere_
      @_Lumiere_ 2 месяца назад

      Do you use it for gaming?

    • @Qohist
      @Qohist 2 месяца назад +3

      @@_Lumiere_ My laptop isnt very strong but it handles games like Mindustry Minecraft Terraria pretty well

    • @jamespae7019
      @jamespae7019 2 месяца назад

      Same. Simply going back a generation when you inevitably screw something up is really neat.

    • @sharperguy
      @sharperguy 2 месяца назад +2

      It's sort of a network effect. Nix is still quite niche and so it's common you run into things that not many other people have tried to do and you struggle to get it to work. But as you fix them you start to realize you can actually build it into a module that you can then publish to make it easier for the next person. On other distros you would usually have to write a tutorial but in nix its just "import this and add an enable=true somewhere"

  • @Nicfallenangel
    @Nicfallenangel 2 месяца назад +1

    The option I went with is a repo setting up neovim in nix, and then home-manager symlinks to the lua in my repo (using mkOutOfStoreSymlink). Then I can edit the lua directly and re-load it easily without having to re-generate it in nix. For those outside of the nix side of things, you can also write/source complete files in a nix file and the "compiler" will spit that file out for the program to read natively in the folder you specify.

  • @mikekellytech
    @mikekellytech 2 месяца назад +1

    Been full timing NixOS for over a year and love it.

  • @henrikstanleymortensen4295
    @henrikstanleymortensen4295 2 месяца назад +1

    To your point Prime.
    Ansible is repeatable, so you can run the same commands again and again with the same input. However it does not guarantee the same output.
    If you use Nix with Flakes that has a lockfile of all deps, nix is repeatable and here is the important part, re-producible.
    Ansible can repeat the same commands over and over again, however if one of those commands uses say, apt-get update, you cannot guarantee you get the same as you ran last time. This is a large part of what the nix ecosystem helps solve.

  • @BLUYES422
    @BLUYES422 2 месяца назад +3

    my setup is to COPY a raw lua file into the config folder upon activationScript that way i can change things fast and if i like it i can copy the file back to the repo and push er up

  • @pengie_
    @pengie_ 2 месяца назад

    I'm so happy prime watched this

  • @trejohnson7677
    @trejohnson7677 Месяц назад

    how many people on planet earth are going to be reaching for nix, neovim, and unable to deal with the 5 minutes 5 neurons overhead of “double configure”.

  • @uchennaofoma4624
    @uchennaofoma4624 2 месяца назад

    Been using it for a while now, it's really dope 👌

  • @KronikAlkoholik
    @KronikAlkoholik 2 месяца назад +1

    NixOS is pretty great, and it only takes you about 2 years worth of weekends for you to be pretty happy with your setup.

  • @WiecejNoxiego
    @WiecejNoxiego 2 месяца назад

    Regarding multiple abstraction levels, I guess the endgame is that each plugin would expose nix options (plugin would have to have it's own flake) inside nix, so you wouldn't have to interact with lua level in any capacity. Nix is pretty nice like that and if the software is already packaged for it you don't get this abstraction stacking on top of each other issue. If it's not though... HF :P

  • @ShaqarudenGames
    @ShaqarudenGames 2 месяца назад

    Nix is really cool. I daily drove it at work for a few weeks in WSL2 but sadly when it came to getting LSPs working in NeoVIM I struggled and had to put it away and go back to Fedora so I could get some work done. Nix requires rethinking of how you set anything up

    • @SpaghettiRealm
      @SpaghettiRealm 2 месяца назад

      Fedora just work, i can’t remember the last time it breaks i have two machines with fedora also the upgrade is straight forward, but tbh im not using anything fancy since all my development project is inside containers no compiler/runtime or interpreter is installed on my host machine

  • @enderger5308
    @enderger5308 2 месяца назад +4

    I’m actually working on something to make getting Guix (a GNU derivative of Nix that uses Scheme for configuration) running much easier. I think we can make something like Neovim distributions for your OS using Nix/Guix (opinionated configurations for your applications by default with the ability to declaratively customise everything). I’m looking to see if I can even use an integrated theming system based on Base16 to generate GTK and QT themes that make the system look coherent.

    • @9s-l-s9
      @9s-l-s9 2 месяца назад

      The first sentence kinda makes no sense 🤔

    • @enderger5308
      @enderger5308 2 месяца назад

      @@9s-l-s9 Ok, let me try to explain. GNU Guix is a project maintained by the ones who made most of the Linux userspace like Bash, GCC, and Coreutils that is built on the Nix package manager. One of its defining features is its use of the Scheme programming language. I’m working on a project which provides sane configurations for a Guix system (alongside additional support for configuring things not supported by it’s configuration system yet) that should provide a better starting point for desktop users out of the box.

  • @Rohinthas
    @Rohinthas Месяц назад

    I'm just here for the Internet Comment Etiquette references... well and also to explore my nix-curiosity... but mostly for Eriks face in the background for like 10s

  • @fedayka
    @fedayka 2 месяца назад

    Is that node_modules for my text editor? AMAZING!

  • @androth1502
    @androth1502 2 месяца назад +1

    nix is one of the small set of linux ideas (immutable OS being the other) that can potentially get me to switch to linux. but i feel that these concepts are still in infancy and need more time to cook.

  • @themohmand
    @themohmand 2 месяца назад +2

    I have never clicked on a video faster than this!

  • @iriolavagno4060
    @iriolavagno4060 2 месяца назад +1

    Nix is like the Red Pill in Matrix, once you start using it you CAN'T see the world in the same way again :-)

  • @marcandruu
    @marcandruu 2 месяца назад +7

    Nix is pretty neat, but it's just felt like a hassle trying to do regular work with it

    • @ardishco
      @ardishco 2 месяца назад +8

      once you set it up it's much less hassle than every other distro imo. I've been doing uni projects with NixOS and I really love how I have no interruptions with my workflow when I update my system.

    • @oserodal2702
      @oserodal2702 2 месяца назад +2

      ​@@ardishcoI wish that were true, but setting up Jupyter + Python was a nightmare.
      On the other hand, NodeJS feels nice out of the box with Nix.

    • @guguludugulu
      @guguludugulu 2 месяца назад

      @@oserodal2702 Huh. Setting up Jupyter + Python for me amounted to `nix-shell -p jupyter`

    • @TurtleKwitty
      @TurtleKwitty 2 месяца назад +1

      It's been annoying to setup for new projects butonce its setup then magically things are always installed when they need to and such so theres no "run these random commands to install the right dependencies" and it documents dependencies without any worries. That said it can bea bit annoying to need to define that you depend on standard ass system things but then its nice casue it ensures that its checked without arcane errors

    • @RegrinderAlert
      @RegrinderAlert 2 месяца назад

      @@oserodal2702How so? That should be super straightforward to achieve - I am curious what your pain points turned out to be

  • @BraxtonMeyer
    @BraxtonMeyer 2 месяца назад +27

    friendly reminder prime. Nix just can be installed over top of a MackOS system just like Linux.

    • @zyansheep
      @zyansheep 2 месяца назад +2

      Can also be installed via WSL!

    • @BraxtonMeyer
      @BraxtonMeyer 2 месяца назад +16

      @@zyansheep "Windows is a niche os for gaming"

    • @marcandruu
      @marcandruu 2 месяца назад

      Yeah it's just a package manager

    • @RobertBMenke
      @RobertBMenke 2 месяца назад

      Nix integration on mac isn’t the greatest for applications. It’s great for command line stuff and dev envs though.

    • @zyriab5797
      @zyriab5797 2 месяца назад

      Prime runs Pop_OS!

  • @thehungryhippy
    @thehungryhippy 2 месяца назад

    > "Finding a computer with nix will be the hard part..."
    The statically linked binary for nix is 40mb or so and runs in user space if you want to manage only a few things (which I do for my work Mac). I installed it on my work mac with no issues with my nvim config. It replaced brew for me as my goto package manager for Mac since I can share configs with my home Linux computers.
    The hardest barrier to entry for Nix is the config language. I would never recommend Nix to the average user, but it's really the best package manager for anyone with technical chops (or linux distro if you go NixOS).

  • @abelgerli
    @abelgerli 2 месяца назад

    I got my bike nix in a few files. The best I can use the modul config on my other machines with no problem.
    Every Linux and Mac machine can use the Nix package manger and therefore use nix flakes for example to a predictable development environment. In Windows just use WSL and the Linux distro you like but even NiOs is a option there.
    When you want to get out of a vendor lock with Redhat use nix.
    You can also create docker container with Nix !

  • @Negative_Light
    @Negative_Light 2 месяца назад

    I really need to learn how to properly use vim/nvim. I know the basics but I think plugins are what I am missing and understanding how to do that will make my rust development.

  • @struntuz
    @struntuz 2 месяца назад

    I generally write configs in nix as any other distro and just use home manager to copy them, it works very well and keeps reproducibility when using flakes and keeping everything on a git repository. Only cases where i tend to use nix configurations are the very simple ones or when i need some more robust integration with nixos like importing something from the store.

  • @m4rt_
    @m4rt_ 2 месяца назад

    I'm happy with using Arch, but I want to try out Nix, since it seems like it would be nice to avoid dependency hell, and it would make it easier to have the same system setup on multiple machines. Though I have heard that it can be a bit annoying when you have to install some software you want, since you have to add it to your config, then reboot.

    • @geryz7549
      @geryz7549 2 месяца назад

      Small correction: You add software to your config and re*build* (not reboot!), which you can do in the background while using your system as usual. You'll only have to reboot if you install a new WM, Display manager, etc

  • @worgenzwithm14z
    @worgenzwithm14z 2 месяца назад +1

    also you can write your config in lua, and then just import that text file into Nix, that way you don't have to write it as lua-in-nix. Also, my neovim setup and my dotfiles are in separate directories. The nix flake just builds nvim, and installs plugins, and then my usual init.lua just imports and activates the plugins

  • @Bomag
    @Bomag 2 месяца назад

    I'm extremely nix curious too. Be fun to watch you dive into it.

  • @cbaesemanai
    @cbaesemanai 2 месяца назад +1

    I have run nix on production environments, run just as fast as you can. Its cool and it can do amazing things but you will need to increse your team by a factor of 10 to maintain it.

  • @corewarrior
    @corewarrior 2 месяца назад

    Have you ever made a video on how you configure and use Ansible? If you haven't that might be cool at some point.

    • @milindchauhan
      @milindchauhan 2 месяца назад +1

      He has a course on frontendmasters called developer productivity or something like that. He goes over ansible there.

  • @Powerofthepickle
    @Powerofthepickle 2 месяца назад +1

    You don't have to double configure. Any time I have a config I might want to share with a non-Nix machine, I just use a regular config file and reference that from the Nix config

  • @cptCrax
    @cptCrax 2 месяца назад +4

    Nix is a brilliant concept. It's nearly identical to Amazon's internal application deployment system (as of a decade ago). I don't know if it's parallel invention or if someone at Amazon couldn't resist spilling the beans because it was just such a useful abstraction. It let us do so many great things like instant rollbacks and the rest of the isolation goodness that you could get via Docker when that came around.

    • @ScibbieGames
      @ScibbieGames 2 месяца назад

      Nix and NixOS are older than Debian.

    • @notanut3686
      @notanut3686 2 месяца назад

      ​@@ScibbieGames they aren't though

    • @ppen9u1n
      @ppen9u1n 2 месяца назад

      nix was invented by Eelco Dostra for his PhD in 2006, see edolstra.github.io/pubs/phd-thesis.pdf

    • @ppen9u1n
      @ppen9u1n 2 месяца назад

      Nix was invented by Eelco Dolstra for/during his PhD thesis (2006, you can find it online). NixOS 0.1 release was in 2003 and it appears to have been "seriously in use" since around 2012 AFAIR.

    • @TheStickofWar
      @TheStickofWar 2 месяца назад

      @@ScibbieGamesDebian came out in the early 90s, Nix came out early 00s

  • @CoinedBeatz
    @CoinedBeatz 2 месяца назад

    I'm experimenting with NixOS for the past days and am trying to see how nix would make it work for me. To avoid double configuration and also alleviate the need to port every dotfile over to the nix wrapper I just let nix copy over the exact dotfiles as they were previously.
    when it comes to theming by variables within the nix configuration or relying on other variables from the config I start to see the benefit of double configuring. Since just setting the config as text and using variable like this, the alternative of double configuring just seems cleaner, but for sure the biggest disadvantage that I encountered so far.
    I keep on experimenting for sure and eventually switch over since I hate to keep my dotfiles in sync with the "atlassian-bare-repo" approach.

    • @ppen9u1n
      @ppen9u1n 2 месяца назад

      If you use NixOS with Home-manager in a flake based setup, you can just start by moving your dot files to (a subdir of) your flake as-is and write them with HM (home.file.). You can then gradually migrate some or all of them to HM module settings as you please.

  • @joewell6435
    @joewell6435 Месяц назад

    as for finding a computer with nix, not as hard as you might think, without root access, the nix package manager can be installed on pretty much any linux distro (Including WSL), Mac, even android.

  • @ETBCOR
    @ETBCOR 2 месяца назад +1

    Yo, could you link the original video? Thanks:)

  • @DimasPangestu-dx7hn
    @DimasPangestu-dx7hn 2 месяца назад

    I admire the versatility of the Nix flake ecosystem as it offers an alternative approach to defining dotfiles.

  • @mikhailman
    @mikhailman 2 месяца назад

    Sorry in advance since i'm VERY new to the whole Vim thing. But wouldn't just storing your init.lua in a github repo effectively be the same thing? Once you have a computer with NeoVim installed you'd just initialize with the cloned file? I know it's a stupid question but ELI5

    • @gunstorm05
      @gunstorm05 2 месяца назад

      Yep, you can import your normal nvim config; This distro seems to be for people who may not already have a config and want one to be setup by nix

    • @ethanweller3013
      @ethanweller3013 2 месяца назад

      The idea is more so that it can generate a config in an entirely reproducible way. If you brick your system you are one command away from reverting everything in your config (including packages) back to before you broke it. It's the only distro I would trust auto-updates on for this reason. I can just revert if anything goes wrong.

  • @tonyb3123
    @tonyb3123 2 месяца назад +4

    Nix is great, I highly recommend it
    The Nix expression language is decidedly terrible, though.

  • @underflowexception
    @underflowexception 2 месяца назад +2

    Nix is a great OS but the Nix the programming language required to program your config is bespoke and a headache.. the documentation isn't the best and there seems to be many ways to do the same thing which is confusing

  • @FrancoGasperino
    @FrancoGasperino 2 месяца назад

    neovim + docker + clojure + repl all within the docker container is pretty fly.

  • @NoLoginIdea
    @NoLoginIdea 2 месяца назад

    Some time ago I was trying to be smart and installed just nix-package manager on my Debian based distro. Stable distor + package manager with AUR-like repo, the dream.
    But the issues kept popping up, quickly outweighing the benefits. Back to building Nvim from source.

  • @alinagy
    @alinagy 2 месяца назад +5

    how did I just find out about nix, its opening my eyes on new horizons

    • @Tobsson
      @Tobsson 2 месяца назад

      Its a nice idea, I just cant find a reason to use it. I only have one Linux comp where I drive Fedora. Usually dont reconfigure it or need to port the conf anywhere. The same goes for nixvim. I have my lua conf on github and dont really need to port the conf anywhere.

    • @vaisakhkm783
      @vaisakhkm783 2 месяца назад

      Have you got out of insane learning curve?

    • @alinagy
      @alinagy 2 месяца назад

      @@vaisakhkm783 I mess around with it on the weekends, eventually it will be conquered

  • @FrankJonen
    @FrankJonen 2 месяца назад +1

    Sounds like a case for Apple's new PKL.

  • @wildwestrom
    @wildwestrom 2 месяца назад

    How do you get autocomplete for Neovim lua? Last time I used a lua lsp server I couldn't get any information.

    • @gunstorm05
      @gunstorm05 2 месяца назад

      Neodev nvim plugin

  • @caedis_
    @caedis_ 2 месяца назад

    Love Vimjoyer's videos on nix and nixos

  • @kmp3e
    @kmp3e 2 месяца назад

    Nix + distrobox and new devs can just get a container for whatever project they’re doing in theory

  • @alienman5000
    @alienman5000 2 месяца назад

    You don’t necessarily need to configure everything using nix language. With Home Manager you can simple copy your existing dot files

  • @derbibliothekarderbiblioth9052
    @derbibliothekarderbiblioth9052 2 месяца назад

    I think if nixvim implements a help feature like neovim but for nixvim everything would be fine, specially if it had the translations and comparisons.

  • @Devoodie
    @Devoodie 2 месяца назад

    You got me into nvim!

  • @Sw3d15h_F1s4
    @Sw3d15h_F1s4 2 месяца назад

    just started using nix as my first Linux distro. it's been challenging, but getting away from windows is worth it. I really like it since I basically can't fuck it up, if I do mess something up just reboot and I'm good.
    the only issue I've had is I accidentally deleted my user from my nixconfig, which made me unable to log in. root password still worked so that's ok. pretty sure there's a setting to prevent this I think.

  • @user-bi3du7or6e
    @user-bi3du7or6e 2 месяца назад +1

    I want to know about nix syntax design choices

  • @EngineerNick
    @EngineerNick 2 месяца назад +1

    I only want neovim for remote dev tasks... I do not want to spend a lifetime making it feel good every time spin up a new raspberry pi zero over wifi. I tried again the other day to set it up and I was really dissapointed with it. "Choose a package manager?" Hekkin flip no, why would it not come built in? This seems like a good option.

  • @harrytsang1501
    @harrytsang1501 2 месяца назад

    Development through docker is the best experience there is if you develop CUDA and need to test more than one version

    • @thekillingspoon
      @thekillingspoon 12 дней назад

      Interesting - I take it you tried with nix and ran into problems? I haven't used CUDA myself, so I'm curious what you ran into. Buggy support in nixpkgs, inability to switch versions without a full system rebuild or something?
      For my own types of projects, I've found development using jetify's Devbox (based on nix devShells) to be much nicer than using Docker containers, due to 1) not needing disk i/o to go through container volume mounts, which slows down some dev workflows a ton, and 2) being able to use my own shell configuration while in a `devbox shell`. However, my personal and work projects are fairly typical web servers and frontends.

    • @harrytsang1501
      @harrytsang1501 12 дней назад

      @@thekillingspoon Nix OS is not at fault here. It's almost the easiest way to setup Nvidia driver.
      However, cuda toolkit as a whole is a mess to setup, and it will fall apart if you try to install more than one version. Whereas Docker completely solves this issue with docker images coming from Nvidia directly

  • @bobbybyrne1899
    @bobbybyrne1899 23 дня назад

    All of the negative points prime makes on abstraction layers and learning the new config are true for all of NixOS. NixOS is an abstraction layer on top of linux. Having to relearn the Nix way for every little thing drove me crazy. The NixOS docs (or lack there of) also drove me crazy. The worst though, was if a problem occurred you're now troubleshooting a problem and also an abstraction layer.

  • @MrSofazocker
    @MrSofazocker 2 месяца назад +2

    Yeah.. why isn't the nix config a Script that also Just Imports configs, why would you have to Copy Paste them into there?

  • @ivanjermakov
    @ivanjermakov 2 месяца назад +1

    Nobody is talking about how nixvim maintainers have to support configuration for every plugin... This is not healthy inversion of control. Remember what happened to null-ls?

  • @c_kemper
    @c_kemper 2 месяца назад +3

    Nix for projects is a no-brainer... and yeah, I just started using nixvim... it has some issues like not lazy loading plugins, but fix will be in the pipeline at some point.
    Nix and direnv... best time saver ever once you get your head around it!

  • @adjbutler
    @adjbutler 2 месяца назад +2

    NIX NVIM! NNNNNNNNNVIMMMMMMMMMMM!

  • @UnhingedNW
    @UnhingedNW 2 месяца назад

    Macintosh mentioned let’s go

  • @jagagemo8141
    @jagagemo8141 2 месяца назад

    I actually really like Helix's in general, but IT Sec hasn't approved it. But they have approved neovim.
    Is there a neovim project out there that's actually just literally Helix?

  • @dustee2680
    @dustee2680 2 месяца назад +1

    After using Nix i realized that no other distro & package manager can even come close to it. Its really a next gen OS, im just worried that i wont ever want to work with non-nix systems ever again.

  • @0xCAFEF00D
    @0xCAFEF00D 2 месяца назад

    3:00
    And it's new neovim users that'd consider a neovim distribution in the first place. So there's not a lot of ways to choose this rationally. For anyone with their own configuration only a small subset would like to move. Like configuration addicts.

  • @clingyking2774
    @clingyking2774 2 месяца назад

    Anyone please link thePrimeagen's Neovim config. He has not updated it on his formal github.

  • @ZTGallagher
    @ZTGallagher Месяц назад

    I always saw nix as a replacement for dev-containers or vagrantboxes.

  • @JChen7
    @JChen7 2 месяца назад +1

    I got upset when I saw a chunk of code in a string in the configs.

  • @dv_xl
    @dv_xl 2 месяца назад +1

    As a user of Nix i strongly agree with prime, I consider this style of config an anti pattern. It just makes config more painful.
    My nix+neovim config simply states dependencys, and then tells nix to load my config (which is a single file for ease of transport).
    What nix is really good at is building isolated software independently, and configuring that build process.
    If you wanted to build a neovim distro and include a bunch of default conf with nix I understand better, but building a nix definition of plugin configs is hard to maintain and likely to bitrot.

    • @zyansheep
      @zyansheep 2 месяца назад

      So I totally agree in the case where you want one config for everything, but if you want like a per-project nvim config (for some reason) nix would be really good for that usecase

  • @hitarthpatel
    @hitarthpatel 2 месяца назад +4

    i use arch BTW , want to switch to nixos but dont have time to do that

    • @KizukiKotataki
      @KizukiKotataki 20 дней назад

      That's how i felt exactly 31 days ago then I switched to NixOS. I wanted to go back but I don't wanna mess with arch config again and NixOS is just a breeze.
      Granted nixos is also annoying to deal with because it has much higher learning curve than arch. Some packages are not even available!!! Like HDSENTINEL. 80k+ packages my ass

  • @eriklundstedt9469
    @eriklundstedt9469 2 месяца назад

    I'd love a nix/guix fork, compatible with the nix repos(or maybe arch based, like a programmable aur-wrapper in lua) but configured in lua(or, for the guix(lisp) enjoyers out there, fennel (fennel is lisp for lua))
    Part of the reason is that you wouldn't really have to do that much "inline" stuff as there are so many things that are already configured in lua
    Tym and wezterm for terminal emulators
    Awesome for the window manager
    Xplr for the (terminal) file explorer/manager
    Nvim for the text editor
    Hilbish for the user shell
    These days it seems to be broken, but there's also luakit web-browser
    And then just stow the files to where they belong or something
    It's got a pretty large ecosystem of language packages too, with lua-rocks
    I'd personally use fd instead of find, bat instead of cat(and less), and exa/lsdeluxe instead of ls
    And im an Emacs user, but that's besides the point

  • @Sestaak
    @Sestaak 2 месяца назад +2

    Do it, come to the dark side...

  • @nadtz
    @nadtz 2 месяца назад

    After I get my proxmox server rebuilt one of the OS's I want to play around with is NixOS, sounds like this might be another one to add to the list to play with as well since I've been training myself to 'relearn' vi/vim/nvim.

  • @vaisakhkm783
    @vaisakhkm783 2 месяца назад

    i don't have double configuration anywhere...
    i use nix just to manage packages, and for quick and easy devshells... i haven't buy into the fully reproducible part of nix..
    all dot files are separate ~/.config folder ... and it's awesome... also😘to flakes...

  • @simonedelpopolo
    @simonedelpopolo 2 месяца назад +1

    Harpooooooooon 😂 7:10

  • @GS12478
    @GS12478 2 месяца назад

    Oh i love NixOS and VIMJoyer!

  • @CrazyMineCuber
    @CrazyMineCuber 2 месяца назад +6

    I mostly agree with you. I absolutely love Nix and NixOS, but for dotfiles it is just more of a headache to configure them in any other language than their native one. I still just Nix in order to get reproducible plugin versions though, but for the dotfiles, I just have Nix glue it together with the plugins and them link the files in their normal configuration locations. I think that is the best of both worlds. You can still do some Nix abstraction magic by generating a glue file where necessary. For example, if I want exactly the same configuration on two different hosts, except for the color scheme or something like that, you can make that happen with NIx.

    • @Muaahaa
      @Muaahaa 2 месяца назад

      I also almost always prefer to use my package specific DSLs or config langs where they exist. I made my own Nix flake for my Neovim that handles plugins and dependencies (like language servers) and then the rest is still handled by Lua.

    • @lolololo-cx4dp
      @lolololo-cx4dp 2 месяца назад

      I literally just use regular nvim configuration and makeoutofstoresymlink lol

    • @CrazyMineCuber
      @CrazyMineCuber 2 месяца назад

      @@lolololo-cx4dp Yes that is the definatelly the way unless you want to make something more comlicated.

  • @SandroPadin
    @SandroPadin 2 месяца назад

    Is there a link to the source video?

  • @user-nq9vh7mv7k
    @user-nq9vh7mv7k 2 месяца назад

    The downside of this is that it does not support lazy loading yet, but there are efforts to implement this. Sometimes it can be tricky to provide raw lua code into the resulting configuration, but overall, this is really amazing.

  • @AminD0
    @AminD0 2 месяца назад

    You can just use your already existing config files and import it in nix instead of writing everything in nix language. So you could combine it.

  • @LarsOksendal
    @LarsOksendal 2 месяца назад

    I'll donate $100 to you when you get into NixOS, flake, home-manager and set up Neovim your way. Looking forward to that video! 🙌 You can use Lua.

  • @railalis
    @railalis 2 месяца назад

    I think keeping your neovim config in lua, and then just compiling it as a plugin through nix is probably the easiest way to migrate. Then all you need nix to do is install the lsp plugins and treesitter. I say this without a fully working config though so I mean, kek.

  • @grawlixes
    @grawlixes 2 месяца назад +1

    NixOS is so rad.

  • @Sindoku
    @Sindoku 2 месяца назад

    Nix is awesome

  • @minegravesgames
    @minegravesgames 2 месяца назад

    Hey prime, just letting you know. If you want to learn nix, you dont have to run nixos to use nix. Hope you try it out❤

  • @FRSilent
    @FRSilent 2 месяца назад

    Watched due to the video length.