Nix-Config Workflow Recipes Using Just

Поділитися
Вставка
  • Опубліковано 21 вер 2024

КОМЕНТАРІ • 26

  • @Peter1215
    @Peter1215 4 місяці тому +3

    Just is really cool, I'm using it it almost every project (mostly infra/k8s focused). One thing I found very useful is combining just recipes with direnv variables if you have sensitive data somewhere. I also found that inlining the scripts is more readable than referencing them via separate files, the just file is bigger, but everything is more accessible.
    On the nix side, I tried to dive into it a few times but was always put off by the quirky syntax and just overall complexity, but maybe with justfile I might give it another try.

    • @Emergent_Mind
      @Emergent_Mind  4 місяці тому +1

      Combining with direnv is a cool idea!
      Nix is a bit daunting given it's differences from the 'norm'. The declarative aspect is what ultimately sold me on diving into it.
      Let me know how it goes if you do give it another try :)
      Thanks for watching!

    • @j3y445
      @j3y445 12 днів тому

      its definitely a rabbit hole to dive into. There's so many components in it, but don't let that scare you away! I started off with just a simple config using the old methods of doing it (with channels, global config in /etc/nixos, etc). But slowly was able to migrate to using flakes and home-manager, then I started getting into multi system setups and soon after overlays, custom modules and custom packages! Just take it one step at a time and I'm sure you can try it again and succeed 🦾

  • @MrPezetko
    @MrPezetko 3 місяці тому +1

    You can specify pre/post dependencies on the command itself like this:
    rebuild: rebuild-pre && rebuild-post
    Will run "rebuild-pre", "rebuild" and "rebuild-post" in this order.

    • @Emergent_Mind
      @Emergent_Mind  3 місяці тому

      Thanks for this! So much to learn :)

  • @khwpp5943
    @khwpp5943 4 місяці тому +1

    Some recipes may be shortened by using specific syntax. You might want to take a look at the examples/ dir at the project's GH page.
    This is a great tool I've been using lately, simpler than Makefile as well. Have you taken a look at the "NH" nix helper?

    • @Emergent_Mind
      @Emergent_Mind  4 місяці тому

      Thanks for the suggestion, I'll look into that.
      I have looked briefly at NH but haven't tried it out yet. It's on the list to explore though :)

    • @brentonbills5946
      @brentonbills5946 4 місяці тому

      Looking forward to the new series. Just looks like Make?

    • @Emergent_Mind
      @Emergent_Mind  4 місяці тому +1

      Glad to hear. It's been an interesting set of problems to solve.
      Just syntax was inspired by Make, but the tool itself is much simpler.
      Thanks for watching!

  • @aaklevtsov
    @aaklevtsov 3 місяці тому +1

    just is good but go-task is better, imho.

    • @Emergent_Mind
      @Emergent_Mind  3 місяці тому

      Any particular reason why? I hadn't heard of it until now but will have a look.
      Thanks for watching and commenting!

    • @aaklevtsov
      @aaklevtsov 3 місяці тому +1

      @@Emergent_Mind go templates, include other task files (including remotes), parallel execution for the deps.

  • @ttrss
    @ttrss 4 місяці тому +3

    for your use case is this not literally just make? I don't see the difference

    • @khwpp5943
      @khwpp5943 4 місяці тому +5

      it's Make, but simpler. just is designed as a command runner rather than a build system which in consequence avoids many complexities from Make.

    • @Emergent_Mind
      @Emergent_Mind  4 місяці тому +2

      My current use case isn't much different but, as @khwpp5943 mentioned, expanding the recipes in the future will keep things simple.
      Thanks for watching!

  • @jahanson
    @jahanson 4 місяці тому

    Do you only need to stage and not commit? I thought you had to commit.

    • @khwpp5943
      @khwpp5943 4 місяці тому +2

      stage only; git add'ing suffices.

  • @anonymouscommentator
    @anonymouscommentator 4 місяці тому

    i dont quite get how this is any different to calling a shell script

    • @Emergent_Mind
      @Emergent_Mind  4 місяці тому +1

      In some ways they are not much different and there is certainly overlap in basic utility. However, just (and make for that matter) are declaritve in nature whereas bash scripts are imperative. Granted, my examples and use case at the moment don't really demonstrate that.
      Thanks for watching and commenting!

    • @anonymouscommentator
      @anonymouscommentator 4 місяці тому

      @@Emergent_Mind thanks for the clarification!

  • @Taddy_Mason
    @Taddy_Mason 2 місяці тому

    I was just thinking about doing this with go-task but I wanted to check out just.

    • @Emergent_Mind
      @Emergent_Mind  2 місяці тому

      Thanks for watching.

    • @Taddy_Mason
      @Taddy_Mason 2 місяці тому

      @@Emergent_Mind thanks for the effort, hopefully you'll have more videos coming out!

    • @Emergent_Mind
      @Emergent_Mind  2 місяці тому +1

      More on the way. Spring and summer outdoor projects are competing for my time :)