I’ve read a lot, but didn’t get a simple answer for 3 topics I’m interested about:

  1. Are there any 3rd party repos for NixOS? It seems some people overlay one package, but I cannot find entire packagesets such as the one in Nixpkgs. Are channels used for that? Would I be able to have my own repo with several packages? Can I have more than 1 repo in my Nix system, and set which package install each program from?
  2. Would it be possible, for propietary software compiled directly for NixOS, to have a binary-only (as opposed to source, or binary+patched) repository? Everything I see is either source+cache or binary+patched, but nothing like binary especifically for NixOS.
  3. Let’s say I want to add some extra, propietary codecs unavailable to NixOS. How would I be able to change a dependency so that each package dependent on it automatically picked it? Could I switch a dependency for a certain repo from one of another, different repo?

Thank you for your support guys!

  • chayleaf
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    11 months ago

    Are there any 3rd party repos?

    Nix has “flakes”, which allow you to share Nix code in a Git repository, it’s like repos on steroids. There are many Git projects that offer new packages (such as nix-gaming) or NixOS modules (such as my project nixos-router), or even just Nix code (such as my projects notlua and notnft, which allow you to write Lua code and nftables rules in Nix), or any combination thereof.

    Would it be possible [for proprietary software to be compiled for NixOS]?

    Kind of. You first have to understand what Nix derivations are - builders that take certain inputs (such as certain versions of libraries) and produce some outputs.

    What happens if the inputs (such as a library version) change? The outputs change as well - previously it was /nix/store/abcdefgh-libfoo/lib/libfoo.so, now it’s /nix/store/ijklmnop-libfoo/lib/libfoo.so - the path to libfoo changes, and the binary’s RPATH reflects that.

    So if you want to package binary software for NixOS, you either have to pin library versions (so the paths don’t ever change), or patch the binary.

    …proprietary codecs…

    It depends on what those codecs are.

    Let’s say they are a binary. In that case, you install them and they get added to your PATH - easy.

    Let’s say they are some data files. In that case you install it and it gets put into XDG_DATA_DIRS - easy.

    Let’s say it’s a shared library (.so). First question - how is that .so loaded? By which program? From where?

    Depending on the answer, what you have to do changes as well. You may have to override some core media library, or ffmpeg, or maybe you can override VLC, or VLC’s ffmpeg, but not system ffmpeg. Or, it may be the case that a simple LD_LIBRARY_PATH change will do it for you.

    Basically - it depends. That’s why NixOS requires a deeper knowledge of Linux, or forces you to learn.