!9IQChSjwSHXPPWTa:lix.systems

Lix

809 Members
Lix user channel. Feel free to discuss on-topic issues here and give each other help. For matrix.to links to the rest of the Lix channels, see: https://wiki.lix.systems/books/lix-organisation/page/matrix-rooms237 Servers

Load older messages


SenderMessageTime
16 Feb 2025
@charles:computer.surgeryCharles so i think what you have is actually fine, but you could also change it to just (localWrapper // extra) because i think including the stuff from pkgs is implied by using pkgs.newScope above 04:50:50
@llakala:matrix.orgllakala
In reply to @charles:computer.surgery
so i think what you have is actually fine, but you could also change it to just (localWrapper // extra) because i think including the stuff from pkgs is implied by using pkgs.newScope above
gotcha I'll try that
04:51:19
@charles:computer.surgeryCharlesif it doesn't work then just pretend i didn't say anything :P04:51:32
@charles:computer.surgeryCharles

tangentially related: Option<T> in nix:

some[T] = [true T];
none = [false];
option[T] = some[T] | none
05:16:35
@charles:computer.surgeryCharles *

tangentially related: Option<T> in nix:

some<T> = [true T];
none = [false];
option<T> = some<T> | none
05:17:13
@charles:computer.surgeryCharles

llakala: okay i did some more testing and read the source of makeScope and now i'm pretty confident that this is the correct way to add extra things to scope.callPackage without exposing them from the scope:

nixpkgs.lib.customisation.makeScope nixpkgs.newScope (scope:
  let
06:30:22
@charles:computer.surgeryCharles *

llakala: okay i did some more testing and read the source of makeScope and now i'm pretty confident that this is the correct way to add extra things to scope.callPackage without exposing them from the scope:

nixpkgs.lib.customisation.makeScope nixpkgs.newScope (scope:
  let
    callPackage = scope.newScope (scope // attrsetWithExtraStuff);
  in
  # do stuff with callPackage
06:31:07
@charles:computer.surgeryCharles *

llakala: okay i did some more testing and read the source of makeScope and now i'm pretty confident that this is the correct way to add extra things to scope.callPackage without exposing them from the scope:

nixpkgs.lib.customisation.makeScope nixpkgs.newScope (scope:
  let
    callPackage = scope.newScope attrsetWithExtraThings;
  in
  # do stuff with callPackage
06:31:57
@charles:computer.surgeryCharles *

llakala: okay i did some more testing and read the source of makeScope and now i'm pretty confident that this is the correct way to add extra things to scope.callPackage without exposing them from the scope:

nixpkgs.lib.customisation.makeScope nixpkgs.newScope (scope:
  let
    callPackage = scope.newScope attrsetWithExtraThings;
  in
  # do stuff with callPackage
)
06:32:17
@irenes:matrix.orgIrenesso um08:30:14
@irenes:matrix.orgIrenesI apologize for making a support request, I know everyone's stretched thin08:30:24
@irenes:matrix.orgIreneslately when I try to build certain things (there's not much pattern to it) I get messages along the lines of08:30:41
@irenes:matrix.orgIrenes ` 08:30:42
@irenes:matrix.orgIrenes
error: unable to download 'https://cache.nixos.org/g3q2v1185b78sn46brs6hxnxlin69f8d.narinfo': HTTP error 404 ()

       response body:
08:30:46
@irenes:matrix.orgIrenesand it just refuses08:30:54
@irenes:matrix.orgIrenes removing ~/.cache/nix/ doesn't help 08:31:04
@irenes:matrix.orgIrenessometimes, for reasons I don't understand, building pieces of it manually causes the problem to go away as if it has never been08:31:17
@irenes:matrix.orgIrenesonly to recur a week or two later08:31:21
@irenes:matrix.orgIrenesI don't know for sure that this is a lix problem08:31:31
@irenes:matrix.orgIrenesbut any thoughts anyone has would be welcome08:31:36
@irenes:matrix.orgIrenes I'm on nix (Lix, like Nix) 2.93.0-dev-pre20250120-5f1782a which I realize may be slightly old 08:31:46
@piegames:flausch.socialpiegames
In reply to @charles:computer.surgery

tangentially related: Option<T> in nix:

some[T] = [true T];
none = [false];
option[T] = some[T] | none
Honestly, this is genuinely the best implementation of sum types I've seen for a dynamically typed language, and also it ties in really well with the idea of using lists as tuples
09:33:43
@piegames:flausch.socialpiegamesThough I'd probably stringify the enum tag instead of using a boolean, especially in combination with symbol optimization (strings in the symbol table compress down to u32)09:35:07
@ma27:nicht-so.sexyma27
In reply to @irenes:matrix.org
I'm on nix (Lix, like Nix) 2.93.0-dev-pre20250120-5f1782a which I realize may be slightly old
IIRC this was indeed a regression on master and the date sounds like you could still be affected. So it probably makes sense to try upgrading.
09:40:24
@irenes:matrix.orgIreneshmm thanks!09:42:11
@aloisw:julia0815.dealoisw changed their profile picture.10:14:30
@noob_tea:matrix.orgtea
In reply to@piegames:flausch.social
Though I'd probably stringify the enum tag instead of using a boolean, especially in combination with symbol optimization (strings in the symbol table compress down to u32)
i am now afraid to ask, how are booleans stored?
11:32:12
@piegames:flausch.socialpiegames
In reply to @noob_tea:matrix.org
i am now afraid to ask, how are booleans stored?
Maybe I was a bit unclear: I'd prefer strings over booleans for usability reasons, and there are ways to do so without eating performance
11:33:57
@noob_tea:matrix.orgtea
In reply to@piegames:flausch.social
Maybe I was a bit unclear: I'd prefer strings over booleans for usability reasons, and there are ways to do so without eating performance
ah okay, I thought you implied that booleans would be larger than an u32 (which would be terrible, but not that surprising, knowing nix)
11:35:46
@piegames:flausch.socialpiegamesI mean they are, at least in the sense that all Nix values are 24 byes (IIRC), but string are still slower because of more allocations and bookkeeping (string context etc.)11:38:05

Show newer messages


Back to Room ListRoom Version: 10