Scripts In Any Language With Nix Writers | NixOS Builders & Writers

Поделиться
HTML-код
  • Опубликовано: 11 сен 2024
  • To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/.... You’ll also get 20% off an annual premium subscription.
    Discord server: / discord
    Donations: ko-fi.com/vimj...
    Nix writers in nixpkgs: github.com/Nix...
    This video was sponsored by Brilliant.

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

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

    To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/Vimjoyer/. You’ll also get 20% off an annual premium subscription.

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

    Honey, a new vimjoyer video just dropped, time to get even more esoteric about how you treat computing!

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

    Ordinary People: Nix doesn't have good documentation *crying intensifies*
    Vimjoyer: I am the documentation.

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

    Nix can also make C and Haskell "scripts", and yes, it's so cool that you can use compiled languages as though they were shell scripts. Honestly makes me want to try replacing NixOS's stage 1 init bash script with a statically compiled binary.

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

    Yay, Vimjoyer got a sponsorship! Congrats!

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

      Never thought this moment would come

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

    One of my fav channels at the moment. Keep up the great work.

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

    omg i just switched to nix last night and im greeted by a new vimjoyer video! excited to continue learning!!

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

      What DE are you using?

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

      @@lexsaito1189 kde plasma

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

      @@lexsaito1189 im using kde

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

      @@lexsaito1189 im currently using kde 6.1 :)

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

    I was wondering how I was gonna deal with my mess of scripts…and now I wanna not just put them in Nix but rewrite them in Rust just because…

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

      haha, you are welcome

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

      dooo itttt

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

    God bless you, dear Vimjoyer for this treesitter highlight thing!!

  • @GrossGeneralization
    @GrossGeneralization Месяц назад +3

    "your favourite language... lua"

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

    Great video as always!

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

    Hey may I request a video about the overview of that awesome config you presented us with a few months ago? Even a updated version of that awesome config, you all your brilliant config ideas in it, so we can learn from it. Gratz and thx once more!

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

    Brilliant sponsorship let's goooooo!!

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

    Awesome !

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

    Дякую!

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

    YOOO SPONSORED!

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

    2 quick questions: 1. What if using zsh in stead of bash when using WriteShellApplication? Thank you! 2. Can define shell env be used repeately? Or using other method such as devbox, conda or even in container? Thank you twice!

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

      writeShellScriptBin uses bash, but you can create your own writer that uses Zsh instead.
      I didn't quite get your second question, but if you want to create a dev shell with packages and environment variables, you can use regular nix shells or devenv. They can be used as many times as you want.

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

      @@vimjoyer 2nd q, atleast i assume is, whether we can use writers to replace simple tools or bashscripts we have in a project within a dev environments..
      also i have a question, in your april fools video, it seemed like you are saying using nix shell nixpkgs\#python312 everytime getting a shell is dumb... i normally don't globally install any langs, but just do that... so i can have difference version on the spot.. is it a bad idea? is there any better way ?

  • @YannMetalhead
    @YannMetalhead Месяц назад +1

    Good video.

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

    Even if the tooling for this exists now, I just don't see the appeal of embedding code from one language in another, especially if that code represents a standalone script or application. I'd much rather handle my scripts like a package in one or more git repos and specify their dependencies how to build them in nix. This way people/systems not using nix can more easily use them.

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

      Sure, but this can be useful for writing small scripts. Sometimes you don't want to write a small script in bash, but you also don't want to start a whole project.

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

      @@vimjoyer True. It clearly is very useful and a great option to know about :)

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

    Is there any way to use writeRustBin using tokio and other rust libraries?

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

    Your videos get me really excited to try nixos, then I boot into my nixos vm, try to do something and hate it. I love the concept and I will stay subscribed but it seems like I am just too much of a dum dum to put these tutorials into action.

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

      I've been daily driving it for months and I still can't replicate most tutorials
      funcional programming is hard, but even so i sure don't regret spending a full week to set up my system.
      I'd always screw myself by dependency helling my system into oblivion and NixOS got rid of that!
      I even managed to setup a custom derivation that builds the game I mod for from source, and with an alias to a short bash script I can update it to the latest git commit in one word, then rebuild and shablam! NixOS does all the compiling for me.

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

      Don't worry, when I initially started with NixOS, I also dropped it almost immediately. You don't have to force yourself to use it, and it's not going to run away from you.
      Just wait until you have plenty of free time and motivation, and then try again 👍

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

      Personally I use bare-bones configuration, just to keep myself and my laptop sane and do not worry about re-creating setup if something will eventually go wrong. For now I do not use more advanced features at all, just enjoying working system :)

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

    can you provide a simple example of using writeShellApplication and using them without adding it to the systemPackages ?

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

      Wrap it with parentheses, and use it like any other nix package

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

    Does inline language highlighting work in Emacs Nix-mode?

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

      It's built into Nix Treesitter grammar, so yeah, it should

  • @Folvin-x1o
    @Folvin-x1o 2 месяца назад +2

    If you enjoy this video

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

    how about push video about devenv witch a good tool for setup env with nix

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

      I am using devenv quite a lot, and I do want to make a video about it, but I first want to wait until the rust rewrite gets a bit more features

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

    cargo install cargo-mommy

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

      my bad this is not kitty