!VRULIdgoKmKPzJZzjj:nixos.org

Nix Package Manager development

835 Members
For people hacking on Nix: https://github.com/NixOS/nix Nix maintainers can be reached here.179 Servers

Load older messages


SenderMessageTime
15 Aug 2025
@fzakaria:one.ems.hostfzakariais there a way to use Nix as a C++ lib in a separate project?15:35:49
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)
In reply to @fzakaria:one.ems.host
is there a way to use Nix as a C++ lib in a separate project?
Pretty easy to do so. Just needs pkg-config integration in your build system. I assume you are going to use bazel?
15:44:21
@fzakaria:one.ems.hostfzakariaNo; i'm happy to use Meson, Cmake or w/e. (Bazel would be cool though) Having a nix derivation that builds it even cooler.15:48:42
@fzakaria:one.ems.hostfzakaria(I'm not familiar with pkg-config) One more question: How does one run a particular flake check only. I'm trying to validate a check that is failing15:49:12
@fzakaria:one.ems.hostfzakaria
nix build -f flake.nix checks.x86_64-linux.nix-fetchers-tests-run
error: attribute 'checks' in selection path 'checks.x86_64-linux.nix-fetchers-tests-run' not found
15:50:35
@dramforever:matrix.orgdramforever nix build .#checks.x86_64-linux.nix-fetchers-tests-run 15:51:50
@fzakaria:one.ems.hostfzakariaty15:51:56
@dramforever:matrix.orgdramforeverquote that if you shell doesn't like it15:52:08
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)Both cmake and meson are pretty easy to set up. Recent enough cmake made this much easier with https://cmake.org/cmake/help/latest/module/FindPkgConfig.html15:54:20
@xokdvium:matrix.orgSergei Zimmerman (xokdvium) You can also do nix build -f . checks.x86_64-linux.nix-fetchers-tests-run, since we are using flake-compat 15:55:14
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)Or (nix-build)15:55:30
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)* Or nix-build15:55:36
@fzakaria:one.ems.hostfzakaria it assumes it was installed on the system ?
So Nix installed via the system will install the shared libraries and headers or is there a -dev version needed.
15:56:09
@fzakaria:one.ems.hostfzakaria (If i were to use Nix as a buildInput) 15:56:21
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)Corresponding components install the .pc files to dev output15:56:50
@fzakaria:one.ems.hostfzakaria cool okay I see the pc files in nix.dev store and they point to the nix lib directory 16:01:51
@fzakaria:one.ems.hostfzakaria(Not sure how someone gets these files without using nix itself but maybe that's by design :P )16:02:29
@fzakaria:one.ems.hostfzakaria Interesting, locally
nix build .#checks.x86_64-linux.nix-fetchers-tests-run passes but on CI it fails.
> The program must call nix::initNix() before calling any libstore library functions.
16:03:56
@fzakaria:one.ems.hostfzakariaimage.png
Download image.png
16:08:44
@fzakaria:one.ems.hostfzakariaAlso, CLion to debug live Nix has been amazing; unfortunately the GoogleTest integration doesn't work -- doesn't seem to hydrate the "Target" 16:08:45
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)Yeah that's pretty unfortunate, but the order of tests matters. It means that locally there's a test that has initialized libstore already16:30:20
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)Can't help here, since I don't have jetbrains stuff16:30:53
@xokdvium:matrix.orgSergei Zimmerman (xokdvium) You'd need to use the new nixComponents packaging. It makes it so you can use the libs without bringing the cli with them 16:32:00
@fzakaria:one.ems.hostfzakariaty for the answers!20:34:03
@fzakaria:one.ems.hostfzakariai recommend the jetbrains stuff; having the gdb integrated debugger has made investigating issues 100x easier20:34:19
@fzakaria:one.ems.hostfzakariaI might invest in trying to get rr working too20:34:25
16 Aug 2025
@connorbaker:matrix.orgconnor (he/him) (UTC-7) Does anyone have any recommended tooling for finding out what values are being kept around by the GC (as well as why they’re being kept around)? 00:31:11
@dramforever:matrix.orgdramforever nix-store --gc --print-roots 04:53:02
@connorbaker:matrix.orgconnor (he/him) (UTC-7)Sorry, I should have disambiguated -- Boehm GC04:54:09
@dramforever:matrix.orgdramforeverlol04:54:15

Show newer messages


Back to Room ListRoom Version: 6