!tDnwWRNkmmYtMXfaZl:nixos.org

Nix Language

1549 Members
Nix programming language276 Servers

Load older messages


SenderMessageTime
6 Aug 2024
@philiptaron:matrix.orgPhilip Taron (UTC-8)

I don't think I really understand tryEval:

$ nix-instantiate --strict --eval --expr 'builtins.tryEval (builtins.elemAt [] 1)'
error:
       … while calling the 'tryEval' builtin
         at «string»:1:1:
            1| builtins.tryEval (builtins.elemAt [] 1)
             | ^

       … while calling the 'elemAt' builtin
         at «string»:1:19:
            1| builtins.tryEval (builtins.elemAt [] 1)
             |                   ^

       error: list index 1 is out of bounds

What makes some error able to be tryEval'd away and what makes it not able to be?

23:50:37
7 Aug 2024
@mattsturg:matrix.orgMatt Sturgeon

I'd have to refer to documentation to give the exact answer, but it depends on how the error was produced.

For example throw can be "caught" by tryEval, but I believe abort cannot.

I'd expect most errors (e.g. failed assert statements) to be the equivalent of a throw rather than an abort.

01:16:32
@mattsturg:matrix.orgMatt Sturgeon I'm surprised elemAt is aborting rather than throwing though 🤔 01:18:28
@daniel573:matrix.orgDaniel Kahlenberg

I have

lib.attrsets.genAttrs [ "nix-inspect" "nixvim-config" "bundix" "feedback" "talon" "rime" "nix-ld-rs" "devenv" ] (name: "input
s.${name}.packages.x86_64.default")
{
  bundix = "inputs.bundix.packages.x86_64.default";
  devenv = "inputs.devenv.packages.x86_64.default";
  feedback = "inputs.feedback.packages.x86_64.default";
  nix-inspect = "inputs.nix-inspect.packages.x86_64.default";
  nix-ld-rs = "inputs.nix-ld-rs.packages.x86_64.default";
  nixvim-config = "inputs.nixvim-config.packages.x86_64.default";
  rime = "inputs.rime.packages.x86_64.default";
  talon = "inputs.talon.packages.x86_64.default";
}

but I want the attrs on the rhs to be attributes not just strings.

How would I achieve that ?

09:56:20
@emilazy:matrix.orgemilyjust drop the quotes09:59:44
@daniel573:matrix.orgDaniel Kahlenberg
In reply to @emilazy:matrix.org
just drop the quotes
Thank you, such a fast solution !
10:01:14
@taffisher:matrix.org@taffisher:matrix.org left the room.19:12:55
@hyperflarex:matrix.orghyperflare left the room.19:16:24
@hyperflarex:matrix.orghyperflare joined the room.19:44:23
@dazai:matrix.orgdazaii'm trying to use colmena with flake-utils so that way I can deploy from my aarch64-linux runner as well as my x86_64-linux runner, but I get meta.nixpkgs must be evaluated in hermetic mode. Anyone run into this? works fine without flake-utils and specifying system = "aarch64-linux" directly https://gist.github.com/abueide/5c8c0fd7bb5c1f70c4ff468748c0375120:17:22
@dazai:matrix.orgdazai left the room.20:47:32
@dazai:matrix.orgdazai joined the room.20:48:13
8 Aug 2024
@tsn9cp:matrix.orgtsn9cp Hi. I'm learning to make derivations and I have an issue where the haxe package manager requires a ~/.haxelib folder for configuration. In my buildPhase I have this: mkdir -p ./lib && haxelib setup ./lib, which then yields this error from haxelib in the output > Error: [file_open,/homeless-shelter/.haxelib]. How would I resolve this? 00:20:12
@ity:itycodes.orgTranquil Ity
In reply to @tsn9cp:matrix.org
Hi. I'm learning to make derivations and I have an issue where the haxe package manager requires a ~/.haxelib folder for configuration. In my buildPhase I have this: mkdir -p ./lib && haxelib setup ./lib, which then yields this error from haxelib in the output > Error: [file_open,/homeless-shelter/.haxelib]. How would I resolve this?
Since that does not seem to be a question about the Nix Language but rather about nixpkgs (as you are talking about buildPhase which is a part of nixpkgs) I feel that you might get better answers in #users:nixos.org
00:24:39
@ity:itycodes.orgTranquil Ity
In reply to @tsn9cp:matrix.org
Hi. I'm learning to make derivations and I have an issue where the haxe package manager requires a ~/.haxelib folder for configuration. In my buildPhase I have this: mkdir -p ./lib && haxelib setup ./lib, which then yields this error from haxelib in the output > Error: [file_open,/homeless-shelter/.haxelib]. How would I resolve this?
* Since that does not seem to be a question about the Nix Language but rather about nixpkgs (as you are talking about buildPhase which is a part of some nixpkgs builders) I feel that you might get better answers in #users:nixos.org
00:24:47
@tsn9cp:matrix.orgtsn9cp
In reply to@ity:itycodes.org
Since that does not seem to be a question about the Nix Language but rather about nixpkgs (as you are talking about buildPhase which is a part of some nixpkgs builders) I feel that you might get better answers in #users:nixos.org
alright, ty
00:25:02
@ity:itycodes.orgTranquil ItyNp ^^00:25:05
@x10an14:matrix.orgx10an14 joined the room.10:03:52
@quapka4:matrix.orgquapka4Hi, is there a canonical way to get the path to the Nix store?10:59:04
@raphi:tapesoftware.netraphi builtins.storeDir? 11:26:58
@quapka4:matrix.orgquapka4
In reply to @raphi:tapesoftware.net
builtins.storeDir?
Thanks
11:45:28
@quapka4:matrix.orgquapka4How can I resolve a string to a function of that name?14:04:00
@quapka4:matrix.orgquapka4Or does there need to be some intermediate attribute set, where the key is the string and the value would be the function directly?14:05:02
@qyliss:fairydust.spaceAlyssa Ross set a profile picture.18:48:40
9 Aug 2024
@meetmangukiya:matrix.orgmeetm joined the room.05:21:59
@meetmangukiya:matrix.orgmeetm how can i pass builtins to nix-darwin from flake.nix ? 05:22:25
@meetmangukiya:matrix.orgmeetmactually i dont need to take it as an arg 05:51:34
@meetmangukiya:matrix.orgmeetmits available globally05:51:42
@mattsturg:matrix.orgMatt Sturgeon Yeah, builtins comes from the nix binary itself, it's not something you can lock with your flake. 09:16:14
@gzgavinzhao:matrix.orgGavin Zhao joined the room.17:08:11

Show newer messages


Back to Room ListRoom Version: 6