!tDnwWRNkmmYtMXfaZl:nixos.org

Nix Language

1518 Members
Nix programming language267 Servers

Load older messages


SenderMessageTime
25 Sep 2024
@artturin:matrix.orgArtturinimage.png
Download image.png
21:13:37
@artturin:matrix.orgArtturin NIX_SHOW_STATS=1 NIX_SHOW_STATS_PATH=stats-interpolation.json nix eval --impure ".#cups-idprt-barcode" 21:14:36
@artturin:matrix.orgArtturin Can't do or (throw "cups-idprt-barcode: No prebuilt filters for system: ${stdenvNoCC.hostPlatform.system}") with getAttr so will have to use the interpolation 21:30:58
@artturin:matrix.orgArtturin

Or

arches = {
  x86_64-linux = "x64";
  x86-linux = "x86";
};
arch =
  if (builtins.hasAttr stdenvNoCC.hostPlatform.system arches) then
    builtins.getAttr (stdenvNoCC.hostPlatform.system) arches
  else
    throw "Not supported on ${stdenvNoCC.hostPlatform.system}";

but this is ugly and also has worse stats

21:36:34
@artturin:matrix.orgArtturinimage.png
Download image.png
21:36:37
@emilazy:matrix.orgemily would be nice if you could say foo.(stdenvNoCC.…) 22:07:21
@buckley310:matrix.orgBuckley joined the room.23:11:54
26 Sep 2024
@fabianhjr:matrix.orgFabián Heredia set a profile picture.01:15:50
@genga898:matrix.orgEmmanuel Genga joined the room.11:44:21
@vendion:matrix.orgvendion joined the room.14:21:54
@simonyde:matrix.org@simonyde:matrix.org left the room.19:30:41
27 Sep 2024
@drupol:matrix.orgPol joined the room.12:09:09
@drupol:matrix.orgPol Heya!
I'm working on this PR https://github.com/hercules-ci/flake.parts-website/pull/1096 and I'm trying to address the first point noted by Robert Hensing (roberth) https://github.com/hercules-ci/flake.parts-website/pull/1096#issuecomment-2378900576
I would like to have some directions on how to do such a function.
I saw that efforts were made in https://github.com/NixOS/nixpkgs/issues/237776, figsoda proposed a function concatMapAttrsWith but I don't know how it could help me for the issue I have.
12:11:15
@drupol:matrix.orgPol

I'm basically looking for transforming such an attribute:

{
             a = {
               b = {
                 c = <derivation hello-2.12.1>;
};

into:

"a/b/c" = <derivation ...>;`
12:13:46
@drupol:matrix.orgPol *

I'm basically looking for transforming such an attribute:

{
  a = {
    b = {
      c = <derivation hello-2.12.1>;
    };
  };
};

into:

"a/b/c" = <derivation ...>;`
12:14:15
@drupol:matrix.orgPol *

I'm basically looking for transforming such an attribute:

{
  a = {
    b = {
      c = <derivation hello-2.12.1>;
    };
  };
};

into:

"a/b/c" = <derivation ...>;`

Knowing that the tree structure can be totally varying.

12:14:51
@drupol:matrix.orgPol I pushed this thing: https://github.com/drupol/pkgs-by-name-for-flake-parts/commit/baf7212a27ec1cb1a1139f8bbc78a184581a4bcd but I have the feeling that it could be simplified/improved using concatMapAttrWith. WDYT? 12:29:08
@figsoda:matrix.orgfigsoda
In reply to @drupol:matrix.org

I'm basically looking for transforming such an attribute:

{
  a = {
    b = {
      c = <derivation hello-2.12.1>;
    };
  };
};

into:

"a/b/c" = <derivation ...>;`

Knowing that the tree structure can be totally varying.

I'm not sure if concatMapAttrsWith would be helpful in this particular case. I did the same thing in fenix to make nested package sets show up in flakes: code, but I just used concatMapAttrs directly
15:45:18
@drupol:matrix.orgPolGoing to check!15:45:36
@figsoda:matrix.orgfigsoda
In reply to @drupol:matrix.org

I'm basically looking for transforming such an attribute:

{
  a = {
    b = {
      c = <derivation hello-2.12.1>;
    };
  };
};

into:

"a/b/c" = <derivation ...>;`

Knowing that the tree structure can be totally varying.

* I'm not sure if concatMapAttrsWith would be helpful in this particular case. I did the same thing in fenix to make nested package sets show up in flakes: code, but I just used concatMapAttrs directly
15:45:52
@drupol:matrix.orgPolThank you!15:46:13
@elikoga:matrix.orgelikoga set a profile picture.16:27:25
@cafkafk:fem.ggcafkafk 🏳️‍⚧️ joined the room.19:11:48
28 Sep 2024
@aleksana:mozilla.orgaleksana (force me to bed after 18:00 UTC) Why is repl allowing if = 1 (can autocomplete if but can't get the value) but not a = { if = 1; }? 02:49:18
@aleksana:mozilla.orgaleksana (force me to bed after 18:00 UTC)I'm reading the lexer and parser but still can't understand why02:49:37
@cafkafk:fem.ggcafkafk 🏳️‍⚧️seems like a repl'ism?02:50:40
@aleksana:mozilla.orgaleksana (force me to bed after 18:00 UTC)The lexer.l just shows keywords take a higher precedence than identifiers02:50:56
@cafkafk:fem.ggcafkafk 🏳️‍⚧️ * seems like a repl'ism? (specially because nix-instantiate --parse --expr 'if = 1' also fails) 02:51:37
@cafkafk:fem.ggcafkafk 🏳️‍⚧️Do you know what part of the code let's you do assignment without let bindings in the repl, I feel like that's a good place to look for this02:54:29
@cafkafk:fem.ggcafkafk 🏳️‍⚧️ Maybe if isVarName denylisted keywords it wouldn't happen? 02:58:11

Show newer messages


Back to Room ListRoom Version: 6