!9IQChSjwSHXPPWTa:lix.systems

Lix

810 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-rooms236 Servers

Load older messages


SenderMessageTime
16 Feb 2025
@llakala:matrix.orgllakalawill have to do some investigating into this04:41:43
@charles:computer.surgeryCharles the infinite recursion is because, for example, nixpkgs has displaycal and my scope also wants to have displaycal, and my scope's displaycal is defined in terms of nixpkgs' displaycal 04:42:51
@charles:computer.surgeryCharles if localWrapper takes precedence over pkgs, then this is obviously infinite recursion 04:43:16
@charles:computer.surgeryCharles but i suspect that also in this case if another local package wants to depend on displaycal, it will get the nixpkgs one instead of my overridden one 04:43:48
@charles:computer.surgeryCharlesohhhhhhhhhhhhhhhh04:49:13
@charles:computer.surgeryCharlesi'm stupid04:49:15
@charles:computer.surgeryCharlesthe reason i wasn't getting infinite recursion before is because i had an extra attrset in the way04:49:27
@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

Show newer messages


Back to Room ListRoom Version: 10