• Using packaged Nix

    From Nicolas George@21:1/5 to All on Fri Jun 28 14:10:02 2024
    Hi.

    I am trying to use Nix on Debian, with the packaged version.

    My goal is to have a pristine Debian OS and the ability to install
    binaries for specific versions of common software independently from the
    OS.

    The problem is: none of the commands I find on the web work in this
    setup.

    For example, I did:

    nix-channel --add https://nixos.org/channels/nixos-24.05 nixos
    nix-channel --update

    Then I check the packages I want:

    https://search.nixos.org/packages?channel=24.05&from=0&size=50&sort=relevance&type=packages&query=postgresql
    https://search.nixos.org/packages?channel=24.05&from=0&size=50&sort=relevance&type=packages&query=ossp
    https://search.nixos.org/packages?channel=24.05&from=0&size=50&sort=relevance&type=packages&query=boost

    And type the commands they suggest:

    nix-shell -p libossp_uuid

    and it fails miserably:

    error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)

    Or:

    nix-env -iA nixpkgs.libossp_uuid

    fails too:

    error: attribute 'nixpkgs' in selection path 'nixpkgs.libossp_uuid' not found

    Can somebody tell me what I am doing wrong and/or give me hints on how
    to get started?

    Alternatively, if you know other packages systems that can achieve a
    similar goal, I can consider using it instead. But it has to handle
    shared dependencies.

    Thanks in advance.

    --
    Nicolas George

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nicolas George@21:1/5 to All on Thu Jul 4 15:10:01 2024
    didier gaumet (12024-06-28):
    Disclaimer: I have never used Nix

    Thanks for the heads up. I kind of hoped somebody who did would see this
    mail.

    from the Nix to Debian phrasebook
    ( https://nixos.wiki/wiki/Nix_to_Debian_phrasebook )
    I would try:
    $ nix-env -qaP '.*libossp_uuid.*'

    Unfortunately, no luck.

    error: selector '.*libossp_uuid.*' matches no derivations

    This phrasebook looked promising, but what it explains is how to use
    Debian when you know Nix and how to use Nix when you know Debian.

    What I need is something that explains how to use Nix on Debian when all
    you have are documentations about Nix not on Debian.

    As an answer to your other question (is there another package system
    managing dependencies available on Debian?), I have never used NetBSD pkgsrc/pkg on Linux but it has long been possible.

    Oh, sorry, I should have been more specific: I would like binary
    packages.

    Thanks for the pointers, even if they do not help.

    Regards,

    --
    Nicolas George

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nicolas George@21:1/5 to All on Fri Jul 5 11:40:01 2024
    didier gaumet (12024-07-04):
    I tried the Debian way (installing nix-setup-systemd, which install nix-bin) without success. I then tried the method quoted in this webpage: https://ariya.io/2020/05/nix-package-manager-on-ubuntu-or-debian
    also without success but I indicate it because perhaps it will give you more hints about what to do

    This or something similar will be the next step if I cannot get the
    packaged version to work.

    It is not the first time I am left wondering why something reaches the
    Debian archive if it does not work. I already noticed that the ARM
    installer advertised support for the RockPi nanocomputers but did not
    manage to boot at all. How?

    While Pkgsrc has long been source only, nowadays it is a whole packaging system, both source and binary since the introduction of Pkgin.
    This webpage seems to confirm what I was suspecting: Pkgsrc would be able manage binary packages on linux: https://opensource.com/article/19/11/pkgsrc-netbsd-linux
    (but I was too lazy to verify by installing and trying myself)

    Thanks.

    There is another property of Nix I need: Nix never replaces a file, it
    only creates new files under different directories. This is important
    for me as I intend to use the same snapshot of the /nix volume connected read-only on multiple virtual machines. That way, I can install a new
    version of, say, PostgreSQL for one VM but the other VMs running the
    older version will not be affected at all until I upgrade them too.

    Do you know if pkgsrc can give the same guarantee?

    (I have also put the Debian /usr on a separate volume with a read-only
    snapshot shared between VMs. The fact that on Debian stable an upgrade
    does not require change in configuration files means I can upgrade the
    system, make a new snapshot and reboot the VMs on it and it will work. I
    even “mv /boot /usr && ln -s usr/boot /boot”. It seems to work. At some point I will write a blog article about it.)

    Regards,

    --
    Nicolas George

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nicolas George@21:1/5 to All on Fri Jul 5 11:30:01 2024
    didier gaumet (12024-07-04):
    (sorry Nicolas, I first sent you a private mail instead of posting on this list, my bad)

    No problem, I just wondered for a few seconds why it arrived twice.

    Guix, the GNU version of Nix, seems (at least basically) functional from the start on Debian:

    sudo apt install guix
    guix search $PACKAGE

    but while there are packages for postgresql and boost, apparently there is none for libossp or ossp

    “GNU Guix provides 28,177 packages” — https://packages.guix.gnu.org/

    “Search more than 100 000 packages” — https://search.nixos.org/packages

    The GNU version seems… less mature.

    Thanks for the pointer though.

    Regards,

    --
    Nicolas George

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)