!tDnwWRNkmmYtMXfaZl:nixos.org

Nix Language

1522 Members
Nix programming language268 Servers

Load older messages


SenderMessageTime
21 Oct 2024
@swendel:curious.bioSebastian
In reply to @artturin:matrix.org
https://github.com/kaii-zen/xinomorf/blob/43092992e19fc533ef8fe67c536d0089870b9220/lib/attrsets.nix#L2
https://github.com/rummik/nixos-config/blob/f88adb6397cdbb775a1b699d866fcb43ef3611a6/users/profiles/nixvim/helpers.nix#L3 and more at
https://github.com/search?q=lang%3Anix+snakeTo&type=code
Geat, thanks.
06:04:48
@veleiro:matrix.orgveleiro joined the room.12:41:27
@sako:imagisphe.resako changed their profile picture.13:04:59
@bwabberton:matrix.orgbeani changed their profile picture.15:27:18
@artur:glasgow.social(artur 'manuel) changed their display name from (lambda (f l) (format nil "~a ~a")) "Artur" "Manuel" to (artur 'manuel).20:04:01
22 Oct 2024
@ihar.hrachyshka:matrix.orgIhar Hrachyshka

is there a lib function to upper-case the first character in a string? I have

mutFirstChar =
    f: s:
    let
      firstChar = f (lib.substring 0 1 s);
      rest = lib.substring 1 (-1) s;
    in
    firstChar + rest;
  toTitle = s: mutFirstChar lib.toUpper s;
  darwinAppName = toTitle binaryName + ".app";

but I feel like there probably should be a builtin for this?

01:07:30
@klaw:matrix.org@klaw:matrix.org joined the room.02:57:03
@klaw:matrix.org@klaw:matrix.org left the room.03:04:35
@human:nitro.chathuman joined the room.04:49:36
@emilazy:matrix.orgemily
In reply to @ihar.hrachyshka:matrix.org

is there a lib function to upper-case the first character in a string? I have

mutFirstChar =
    f: s:
    let
      firstChar = f (lib.substring 0 1 s);
      rest = lib.substring 1 (-1) s;
    in
    firstChar + rest;
  toTitle = s: mutFirstChar lib.toUpper s;
  darwinAppName = toTitle binaryName + ".app";

but I feel like there probably should be a builtin for this?

it's not something you can really do reliably. Nix has no Unicode support
06:45:06
@emilazy:matrix.orgemily e.g. binaryName = "éclair" gives an unexpected result 06:46:32
@emilazy:matrix.orgemily(not that there aren't existing string manipulation functions that have this issue, just a caveat. in general you're actually often better if you can do the string manip by shelling out instead)06:47:16
@emilazy:matrix.orgemily(if you don't absolutely need it at eval time)06:47:21
@stooj:matrix.org@stooj:matrix.org left the room.08:15:11
@zarel_it:matrix.org@zarel_it:matrix.org left the room.09:31:30
@fernsehmuell:matrix.org@fernsehmuell:matrix.org set a profile picture.18:13:44
@o-santi:matrix.orgLeonardo Santiagoabout the nix C api21:05:12
@o-santi:matrix.orgLeonardo SantiagoI've been putting some good work on making a decent rust wrapper around the nix C api, in order to use it elsewhere21:06:02
@o-santi:matrix.orgLeonardo Santiagoand while it mostly works as expected, there are some corner weird corner cases21:06:34
@o-santi:matrix.orgLeonardo Santiago I've been developing on commit ed129267dcd7dd2cce48c09b17aefd6cfc488bcd (same as Robert Hensing (roberth) 's nixops4), because after that builtins.getFlake stop working in the C api 21:07:40
@o-santi:matrix.orgLeonardo SantiagoI thought that was the only problem, but apparently some of the settings don't work?21:08:24
@o-santi:matrix.orgLeonardo Santiago for some reason, some settings work fine (extra-experimental-features, max-jobs) while some throw "setting not found" error 21:09:36
@o-santi:matrix.orgLeonardo Santiago for instance, the one that triggered me on this is trace-function-calls, which seems to not exist 21:10:08
@o-santi:matrix.orgLeonardo Santiago I've tried looking at the source code but I'm not that good in C++ and there seems to be some spooky effects at a distance going on, as I don't understand how the *configRegistrations under GlobalConfig is populated 21:12:32
@o-santi:matrix.orgLeonardo Santiago if I understood correctly, the relevant settings are under EvalSettings, instantiated and registered in libcmd/common-eval-args.cc. for some reason, all the settings in there don't seem to appear for the C api. am i doing something wrong? 21:14:17
@o-santi:matrix.orgLeonardo Santiago * if I understood correctly, the relevant settings are under EvalSettings, instantiated and registered in src/libcmd/common-eval-args.cc (at least, in that commit). for some reason, all the settings in there don't seem to appear for the C api. am i doing something wrong? 21:14:32
@o-santi:matrix.orgLeonardo Santiago the code is in https://github.com/o-santi/nix-forall, if anyone wants to take a look 21:19:31
@o-santi:matrix.orgLeonardo Santiago * the code is in https://github.com/o-santi/nix-forall, under nix-for-rust if anyone wants to take a look 21:19:48
@o-santi:matrix.orgLeonardo Santiago just change main.rs to set .with_settings("trace-function-calls", "true") and nix run should reproduce the error. 21:20:47
@roberthensing:matrix.orgRobert Hensing (roberth) Hi Leonardo Santiago , I believe that may have been caused by some refactoring we've done in the settings area. We're trying to get rid of the "spooky action at a distance" global variable stuff, but we may have made a mistake, going from spooky to none for the C API 21:51:14

Show newer messages


Back to Room ListRoom Version: 6