16 Feb 2025 |
llakala | will have to do some investigating into this | 04:41:43 |
Charles | 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 | if localWrapper takes precedence over pkgs , then this is obviously infinite recursion | 04:43:16 |
Charles | 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 | ohhhhhhhhhhhhhhhh | 04:49:13 |
Charles | i'm stupid | 04:49:15 |
Charles | the reason i wasn't getting infinite recursion before is because i had an extra attrset in the way | 04:49:27 |
Charles | 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 | 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 | if it doesn't work then just pretend i didn't say anything :P | 04:51:32 |
Charles | tangentially related: Option<T> in nix:
some[T] = [true T];
none = [false];
option[T] = some[T] | none
| 05:16:35 |
Charles | * tangentially related: Option<T> in nix:
some<T> = [true T];
none = [false];
option<T> = some<T> | none
| 05:17:13 |
Charles | 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 | * 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 | * 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 | * 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 | so um | 08:30:14 |
Irenes | I apologize for making a support request, I know everyone's stretched thin | 08:30:24 |
Irenes | lately when I try to build certain things (there's not much pattern to it) I get messages along the lines of | 08:30:41 |
Irenes | ` | 08:30:42 |
Irenes | error: unable to download 'https://cache.nixos.org/g3q2v1185b78sn46brs6hxnxlin69f8d.narinfo': HTTP error 404 ()
response body:
| 08:30:46 |
Irenes | and it just refuses | 08:30:54 |
Irenes | removing ~/.cache/nix/ doesn't help | 08:31:04 |
Irenes | sometimes, for reasons I don't understand, building pieces of it manually causes the problem to go away as if it has never been | 08:31:17 |
Irenes | only to recur a week or two later | 08:31:21 |
Irenes | I don't know for sure that this is a lix problem | 08:31:31 |
Irenes | but any thoughts anyone has would be welcome | 08:31:36 |
Irenes | I'm on nix (Lix, like Nix) 2.93.0-dev-pre20250120-5f1782a which I realize may be slightly old | 08:31:46 |
piegames | 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 | 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) | 09:35:07 |