!VRULIdgoKmKPzJZzjj:nixos.org

Nix Package Manager development

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

Load older messages


SenderMessageTime
10 Nov 2025
@Ericson2314:matrix.orgJohn Ericsonand think about these things some more03:29:03
@tomberek:matrix.orgtomberekWe can either hook up the GitHub PR integration or just do it manually for a bit. (Or make a CLI tool and API it....... hrm...)03:30:36
@Ericson2314:matrix.orgJohn EricsonI tried to set up mege queues for hnix store and failed horribly lol --- github is hard!03:32:35
@friedow:beeper.com@friedow:beeper.com left the room.08:20:15
@roberthensing:matrix.orgRobert Hensing (roberth)ready for merge: https://github.com/NixOS/flake-compat/pull/7711:26:46
@fzakaria:one.ems.hostfzakariaI have been swamped with new job but I miss coding with you guys :(16:49:49
@fzakaria:one.ems.hostfzakaria* I have been swamped with new job but I miss coding with you all :(16:49:54
@Ericson2314:matrix.orgJohn Ericson
From 42645063302e328e26360cb08baceb5107fbfa8c Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <edolstra@gmail.com>
Date: Mon, 3 Mar 2025 13:10:08 +0100
Subject: [PATCH] Imply --offline during tab completion

Previously, if you don't have Internet connectivity, tab completion
might try to fetch the flake registry, e.g.

  $ NIX_GET_COMPLETIONS=4 nix build -vvvvv --offline /home/eelco/De
  evaluating file '<nix/derivation-internal.nix>'
  downloading 'https://channels.nixos.org/flake-registry.json'...
  warning: error: unable to download 'https://channels.nixos.org/flake-registry.json': Could not resolve hostname (6) Could not resolve host: channels.nixos.org; retrying in 294 ms
  warning: error: unable to download 'https://channels.nixos.org/flake-registry.json': Could not resolve hostname (6) Could not resolve host: channels.nixos.org; retrying in 541 ms
  warning: error: unable to download 'https://channels.nixos.org/flake-registry.json': Could not resolve hostname (6) Could not resolve host: channels.nixos.org; retrying in 1230 ms
  warning: error: unable to download 'https://channels.nixos.org/flake-registry.json': Could not resolve hostname (6) Could not resolve host: channels.nixos.org; retrying in 2285 ms
  warning: error: unable to download 'https://channels.nixos.org/flake-registry.json': Could not resolve hostname (6) Could not resolve host: channels.nixos.org; using cached version
---
 src/nix/main.cc | 32 +++++++++++++++++++++-----------
 1 file changed, 21 insertions(+), 11 deletions(-)

diff --git a/src/nix/main.cc b/src/nix/main.cc
index 74d22e4336..b75e49cc3d 100644
--- a/src/nix/main.cc
+++ b/src/nix/main.cc
@@ -86,6 +86,19 @@ static bool haveInternet()
 #endif
 }

+static void disableNet()
+{
+    // FIXME: should check for command line overrides only.
+    if (!settings.useSubstitutes.overridden)
+        settings.useSubstitutes = false;
+    if (!settings.tarballTtl.overridden)
+        settings.tarballTtl = std::numeric_limits<unsigned int>::max();
+    if (!fileTransferSettings.tries.overridden)
+        fileTransferSettings.tries = 0;
+    if (!fileTransferSettings.connectTimeout.overridden)
+        fileTransferSettings.connectTimeout = 1;
+}
+
 std::string programPath;

 struct NixArgs : virtual MultiCommand, virtual MixCommonArgs, virtual RootArgs
@@ -482,6 +495,12 @@ void mainWrapped(int argc, char ** argv)
         }
     });

+    if (getEnv("NIX_GET_COMPLETIONS"))
+        /* Avoid fetching stuff during tab completion. We have to this
+           early because we haven't checked `haveInternet()` yet
+           (below). */
+        disableNet();
+
     try {
         auto isNixCommand = std::regex_search(programName, std::regex("nix$"));
         auto allowShebang = isNixCommand && argc > 1;
@@ -525,17 +544,8 @@ void mainWrapped(int argc, char ** argv)
         args.useNet = false;
     }

-    if (!args.useNet) {
-        // FIXME: should check for command line overrides only.
-        if (!settings.useSubstitutes.overridden)
-            settings.useSubstitutes = false;
-        if (!settings.tarballTtl.overridden)
-            settings.tarballTtl = std::numeric_limits<unsigned int>::max();
-        if (!fileTransferSettings.tries.overridden)
-            fileTransferSettings.tries = 0;
-        if (!fileTransferSettings.connectTimeout.overridden)
-            fileTransferSettings.connectTimeout = 1;
-    }
+    if (!args.useNet)
+        disableNet();

     if (args.refresh) {
         settings.tarballTtl = 0;
--
2.50.1
17:47:02
@djspacewhale:4d2.org@djspacewhale:4d2.org left the room.19:05:26
@Ericson2314:matrix.orgJohn Ericson lovesegfault: git range-diff 14c70d08071093d81d4d614d0e36bbd1db19cf24^..14c70d08071093d81d4d614d0e36bbd1db19cf24 273f7a08421f763788e4c214cca165868617480f^..273f7a08421f763788e4c214cca165868617480f 19:36:25
@Ericson2314:matrix.orgJohn Ericsonreviewing your stuff19:36:27
@shine:proqqul.netTaeer Bar-Yam

Sergei Zimmerman (xokdvium) I'm trying to move the data into arena, and something appears to be leaking. Any idea why? The assignment operator should clean up the existing value, right?

        attrs = AttrDefs{std::move(attrs), arena};
        if (inheritFromExprs)
            inheritFromExprs = std::make_unique<std::pmr::vector<Expr *>>(std::move(*inheritFromExprs), arena);
        dynamicAttrs = DynamicAttrDefs{std::move(dynamicAttrs), arena};
21:49:47
@shine:proqqul.netTaeer Bar-Yam

std::map move constructor (AttrDefs is std::map):

      /// Allocator-extended move constructor.
      map(map&& __m, const __type_identity_t<allocator_type>& __a)
      noexcept(is_nothrow_copy_constructible<_Compare>::value
	       && _Alloc_traits::_S_always_equal())
      : _M_t(std::move(__m._M_t), _Pair_alloc_type(__a)) { }
22:12:33
11 Nov 2025
@roberthensing:matrix.orgRobert Hensing (roberth)Would be great to have range diffs for force pushes on GitHub https://github.com/NixOS/nix/issues/1454309:30:31
@roberthensing:matrix.orgRobert Hensing (roberth) Mic92: would you be able to set that up? 09:30:54
@joerg:thalheim.ioMic92Maybe in non-critical infra?09:32:32
@roberthensing:matrix.orgRobert Hensing (roberth)I'm not familiar with that, but sounds great09:32:50
@joerg:thalheim.ioMic92We got a server running a bunch of random things in NixOS infra09:33:19
@joerg:thalheim.ioMic92actually two09:33:24
@roberthensing:matrix.orgRobert Hensing (roberth)Seems like an ok place to run this too then09:33:45
@joerg:thalheim.ioMic92where is the source for this?09:34:02
@roberthensing:matrix.orgRobert Hensing (roberth)seems to be https://github.com/rust-lang/triagebot09:34:31
@roberthensing:matrix.orgRobert Hensing (roberth)ah, needs packaging09:35:19
@roberthensing:matrix.orgRobert Hensing (roberth)unless you want to experiment with an unpackaged build09:35:43
@roberthensing:matrix.orgRobert Hensing (roberth)I feel quite confident that this would add value though09:35:54
@mschwaig:matrix.orgMartin Schwaighoferhttps://github.com/mschwaig/nixpkgs/tree/triagebot 😄13:57:49
@joerg:thalheim.ioMic92what else does it do beyond range-diff?15:06:57
@joerg:thalheim.ioMic92For range-diff I am almost inclined to just have a github action. It doesn't sound too code.15:07:39
@roberthensing:matrix.orgRobert Hensing (roberth)Merge conflict notifications also stood out to me15:11:10
@roberthensing:matrix.orgRobert Hensing (roberth)Basically see the menu under Triagebot at https://forge.rust-lang.org/triagebot/index.html15:11:41

Show newer messages


Back to Room ListRoom Version: 6