• wheresmysurplusvalue [comrade/them]
    ·
    edit-2
    3 months ago

    nix develop just drops you into a shell which has all your environment variables set correctly and packages available in your $PATH. And for that, it will use the same functionality to either re-use a package you already downloaded, or check if it's available as a binary from a binary cache, or in the last case it will bulid from source.

    I'm not doing much hobby development these days, but I think nix develop can be used in tandem with direnv (https://direnv.net/) to get you to a development shell automatically, just by navigating to the directory in your terminal.

    • loathesome dongeater@lemmygrad.ml
      ·
      edit-2
      3 months ago

      I have a favour to ask of you. Please feel free to ignore if you don't have the bandwidth. I won't mind at all.

      I was thinking of putting NixOS on my SBC so that I could version control its configuration and also learn NixOS. Due to the weird nature of SBCs it's not guaranteed every Linux distribution will work on them.

      I found this repository pertaining to running NixOS on it: https://github.com/povik/nixos-on-odroid-n2

      The favour I mentioned before is that I have two questions about it:

      1. Is this repository still relevant despite having no commits in over three years?
      2. What does this repository exactly do? I cannot in good conscience ask you to go in details but some high level explanation would be appreciated. I tried reading the .nix files but they made no sense to me.
      • wheresmysurplusvalue [comrade/them]
        ·
        edit-2
        3 months ago

        Hi! Sorry that it's probably beyond me, the smallest computer I have installed Nixos on is a raspberry pi. It was pretty easy because I just used instructions online from someone who already did it. I'm on a trip without my laptop at the moment so I can't try building from this repo.

        But the process for building for rpi is that there's a way to define a configuration.nix that gets used to generate an SD card image. So that looks like what the repository you used is doing. You run nix build to generate the image (goes into a 'result' directory) and then you can flash that to an SD card (for example using dd).

        Also, I saw this fork of the repo you linked, looks like someone added a little bit of instructions how to cross-compile (so you don't need to build from an aarch64 machine) and also updated a path which changed between nixos versions.

        https://github.com/ardumont/nixos-on-odroid-n2

        If this repo works for you, I'd recommend using a remote deployment tool like deploy-rs. I use it for my raspberry pi. It means I can build (cross-compile) packages for the rpi on my desktop computer, and then copy the packages to the rpi via ssh and activate the generation.

      • wheresmysurplusvalue [comrade/them]
        ·
        3 months ago

        One more comment! You might see some differences in nix commands being used across different blogs. This is because they are slowly migrating to a new command line API and away from the old API. Generally, if it's using the new API (experimental/unstable), then it just uses the nix command. The older stable API generally has dashes, like nix-build, nix-shell, etc. But there's usually some matching command in both APIs.