I’m very, very new to nix and nixOS both - I come from imperative workflows and very very rarely anything determinative, so this is all brand new to me.

As an example of the kind of thing I don’t understand how to do, let’s take an example repo I’ve been bouncing off: https://github.com/GideonWolfe/Chameleon

On a “normal” system, I can get pip and python ready, and then make install and I’m off to the races.

With NixOS, I’ve got as far as adding python3 and gnumake to my configuration.nix packages. (I have also discovered that putting python in my system packages was the wrong move, so some advice on how better to go about this would be cool too.)

I can’t for the life of me wrap my head around what I’m supposed to do, and so many people online are using flakes but I’m on stable 23.11 (and quite daunted by flakes) so I’d prefer if this was from that POV.

Can anyone speak to any of these points? I’ve tried reading the docs but it’s very confusing for some reason.

  • Grand@programming.dev
    link
    fedilink
    English
    arrow-up
    3
    ·
    7 months ago

    I’m also fairly new to NixOS and also nix flakes, but there isn’t much to be daunted by. A nix flakes config and a normal nixos config are identical except for the inclusion of a flake.nix file which declares what inputs (sources) you’re using, otherwise it’s identical. I’d recommend taking a look at this video which covers NixOS configuration as well as switching to nix flakes. The timestamp I included drops you off at the nix flake section of the video.

    Once you’ve got that understood you can either find or write a nix flake for the program you want and include it in your config and use the modules from it. If you write it you’ll need to make a derivation as verstra has said in another comment, which just says how to get the source files, what dependencies are needed for building, what dependencies are needed for installing and how to build and install it. This video goes into some details about derivations which may help.

    It’s a lot more involved than other distros but it gives you more control. I’m not fully switched over yet but i do want to switch over as soon as i can.

    • apotheotic (she/her)@beehaw.orgOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      7 months ago

      That’s very helpful, I’ll take a look. Thank you!

      I’m enjoying the aspect of nixos insofar as it “forcing” me to understand what’s actually going on a bit more than other distros. I decided to basically take off the training wheels and just installed a bare nixos install - no DM just a shell (which was a first for me too). I’m getting situated with hyprland (which, I’m led to understand is also a steep learning curve). Its a lot of fun but I’m doing a lot of head scratching.