Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #270538 > unrolled thread

Using packaged Nix

Started byNicolas George <george@nsup.org>
First post2024-06-28 14:10 +0200
Last post2024-07-05 11:30 +0200
Articles 8 — 2 participants

Back to article view | Back to linux.debian.user


Contents

  Using packaged Nix Nicolas George <george@nsup.org> - 2024-06-28 14:10 +0200
    Re: Using packaged Nix didier gaumet <didier.gaumet@gmail.com> - 2024-06-28 18:10 +0200
      Re: Using packaged Nix Nicolas George <george@nsup.org> - 2024-07-04 15:10 +0200
        Re: Using packaged Nix didier gaumet <didier.gaumet@gmail.com> - 2024-07-04 17:30 +0200
          Re: Using packaged Nix Nicolas George <george@nsup.org> - 2024-07-05 11:40 +0200
            Re: Using packaged Nix didier gaumet <didier.gaumet@gmail.com> - 2024-07-05 12:50 +0200
        Re: Using packaged Nix didier gaumet <didier.gaumet@gmail.com> - 2024-07-04 18:50 +0200
          Re: Using packaged Nix Nicolas George <george@nsup.org> - 2024-07-05 11:30 +0200

#270538 — Using packaged Nix

FromNicolas George <george@nsup.org>
Date2024-06-28 14:10 +0200
SubjectUsing packaged Nix
Message-ID<IUiAq-6cOd-3@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#270546

Fromdidier gaumet <didier.gaumet@gmail.com>
Date2024-06-28 18:10 +0200
Message-ID<IUmkF-6f3D-9@gated-at.bofh.it>
In reply to#270538
Hello,

Disclaimer: I have never used Nix

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

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. And pkgsrc used to be 
a source package management system but its pkg binary package management 
alter ego has been introduced since then. I am not absolutely positive 
that pkg (binary) can be used on Linux, but I strongly suppose so.

how to use pkgsrc on linux:
https://wiki.netbsd.org/pkgsrc/how_to_use_pkgsrc_on_linux/
Using pkgsrc (binary and source):
http://netbsd.org/docs/pkgsrc/using.html

for example, pkgsrc has no libossp_uuid package but does have a 
ossp_uuid one:
https://pkgsrc.se/devel/ossp-uuid

Perhaps others more knowledgeable in pkgsrc than me will chime in :-)
https://pkgsrc.se/devel/ossp-uuid

[toc] | [prev] | [next] | [standalone]


#270814

FromNicolas George <george@nsup.org>
Date2024-07-04 15:10 +0200
Message-ID<IWunL-7D5A-7@gated-at.bofh.it>
In reply to#270546
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

[toc] | [prev] | [next] | [standalone]


#270820

Fromdidier gaumet <didier.gaumet@gmail.com>
Date2024-07-04 17:30 +0200
Message-ID<IWwzg-7EkO-9@gated-at.bofh.it>
In reply to#270814
Le 04/07/2024 à 15:07, Nicolas George a écrit :

> Unfortunately, no luck.
[...]
> What I need is something that explains how to use Nix on Debian when all
> you have are documentations about Nix not on Debian.

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

>> 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.

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)

[toc] | [prev] | [next] | [standalone]


#270863

FromNicolas George <george@nsup.org>
Date2024-07-05 11:40 +0200
Message-ID<IWNA5-7P35-9@gated-at.bofh.it>
In reply to#270820
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

[toc] | [prev] | [next] | [standalone]


#270865

Fromdidier gaumet <didier.gaumet@gmail.com>
Date2024-07-05 12:50 +0200
Message-ID<IWOFP-7PGT-5@gated-at.bofh.it>
In reply to#270863
Le 05/07/2024 à 11:31, Nicolas George a écrit :
[...]
> 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?

Sorry, I have used pkgsrc (on NetBSD only) really long ago, when it was 
source only, and it was not an intensive use.
So I can not answer

> (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.)

I am not knowledgeable about this matter, neither.

Perhaps (*big* conditional here) something like rpm-ostree or a custom 
combination of libostree and another package manager (the latter, I 
don't even know if it is possible in real life with only a limited 
effort) could be interesting to you:
https://coreos.github.io/rpm-ostree/
https://en.wikipedia.org/wiki/OSTree

[toc] | [prev] | [next] | [standalone]


#270822

Fromdidier gaumet <didier.gaumet@gmail.com>
Date2024-07-04 18:50 +0200
Message-ID<IWxOG-7F1i-1@gated-at.bofh.it>
In reply to#270814
(sorry Nicolas, I first sent you a private mail instead of posting on 
this list, my bad)

Le 04/07/2024 à 15:07, Nicolas George a écrit :

 > Unfortunately, no luck.
 >
 > error: selector '.*libossp_uuid.*' matches no derivations
[...]

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

[toc] | [prev] | [next] | [standalone]


#270862

FromNicolas George <george@nsup.org>
Date2024-07-05 11:30 +0200
Message-ID<IWNqp-7OZF-7@gated-at.bofh.it>
In reply to#270822
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web