21 Oct 2024 |
Sebastian | 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 joined the room. | 12:41:27 |
| sako changed their profile picture. | 13:04:59 |
| beani changed their profile picture. | 15:27:18 |
| (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 | 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 joined the room. | 02:57:03 |
| @klaw:matrix.org left the room. | 03:04:35 |
| human joined the room. | 04:49:36 |
emily | 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 |
emily | e.g. binaryName = "éclair" gives an unexpected result | 06:46:32 |
emily | (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 |
emily | (if you don't absolutely need it at eval time) | 06:47:21 |
| @stooj:matrix.org left the room. | 08:15:11 |
| @zarel_it:matrix.org left the room. | 09:31:30 |
| @fernsehmuell:matrix.org set a profile picture. | 18:13:44 |
Leonardo Santiago | about the nix C api | 21:05:12 |
Leonardo Santiago | I've been putting some good work on making a decent rust wrapper around the nix C api, in order to use it elsewhere | 21:06:02 |
Leonardo Santiago | and while it mostly works as expected, there are some corner weird corner cases | 21:06:34 |
Leonardo 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 |
Leonardo Santiago | I thought that was the only problem, but apparently some of the settings don't work? | 21:08:24 |
Leonardo Santiago | for some reason, some settings work fine (extra-experimental-features , max-jobs ) while some throw "setting not found" error | 21:09:36 |
Leonardo Santiago | for instance, the one that triggered me on this is trace-function-calls , which seems to not exist | 21:10:08 |
Leonardo 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 |
Leonardo 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 |
Leonardo 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 |
Leonardo Santiago | the code is in https://github.com/o-santi/nix-forall , if anyone wants to take a look | 21:19:31 |
Leonardo 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 |
Leonardo Santiago | just change main.rs to set .with_settings("trace-function-calls", "true") and nix run should reproduce the error. | 21:20:47 |
Robert 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 |