<infinisil>
While not strictly necessary, I implemented a recursiveUntil function that doesn't suffer from stack overflows
<adisbladis>
infinisil: Nice, how? :)
<infinisil>
(not that there is such a function in nixpkgs already, but the naive recursive implementation stack overflows)
<infinisil>
Put them both in the bot here
<infinisil>
> :v recursiveUpdateRecursive
<{^_^}>
recursiveUpdateRecursive = recursiveUpdateRecursive is not defined
<infinisil>
Wow I'm tired, it's *iterateUntil*
<infinisil>
> :v iterateUntil
<{^_^}>
iterateUntil = cond: trans: let iterateUntilN = n: state: lib.foldl' (state: _: if cond state then state else trans state ) state (lib.genList throw n); go = n: state: if cond state then state else go (n * 2) (iterateUntilN n state); in go 1
<infinisil>
> :v iterateUntilRecursive
<{^_^}>
iterateUntilRecursive = cond: trans: let go = state: if cond state then state else go (trans state); in go
<infinisil>
> iterateUntilRecursive (x: x > 10000) (x: x + 1) 0
<adisbladis>
I figured it was gonna be that
<{^_^}>
10001
<infinisil>
> iterateUntilRecursive (x: x > 100000) (x: x + 1) 0
<adisbladis>
Those filter functions would benefit greatly
<infinisil>
Nice
<infinisil>
adisbladis: findFirst = pred: default: list: let index = builtins.iterateUntil (i: i >= lib.length list || pred (lib.elemAt list i)) (i: i + 1) 0; in if index >= lib.length list then default else lib.elemAt index
<infinisil>
Decently nice implementation of lazy findFirst
<infinisil>
adisbladis: Actually, since this is pretty much a while statement, this could be used almost anywhere where you have recursino
* infinisil
goes to #nix-lang
<infinisil>
Don't wanna spam more than I already have :P
lassulus has quit [Ping timeout: 258 seconds]
lassulus has joined #nixos-chat
red[evilred] has quit [Quit: Idle timeout reached: 10800s]
pieguy128 has joined #nixos-chat
<pie_>
im not sure if 6 people from mit and 2 from stanford are crackpots, but this *may* be interesting, i havent read through it:
<pie_>
<x> "https://arxiv.org/abs/2007.11112 quite a manifesto" [2007.11112] DBOS: A Proposal for a Data-Centric Operating System (Current operating systems are complex systems that were designed before)
<pie_>
"As a result, debugging has become much more complex and involves a flow of control inmultiple environments. Debugging such a network of tasks is a real challenge, not consideredforty years ago"
<pie_>
caught my eye because i keep thinking about wanting to improve our "enable debugging" stacks
waleee-cl has quit [Quit: Connection closed for inactivity]
<etu>
gchristensen: Sounds horrible :o
<gchristensen>
the idea or the gist?
<etu>
I never actually had any real issues with zfs... So I never had to debug it in any way... I made some issues for myself on one of my boxes that has redudant boot just to try it out...
<gchristensen>
nice
<etu>
And AoC is starting about now
<gchristensen>
I like that zfs will trivially let you use files as backing stores for zpools, so you can muck about without needing actual disks or without setting up loopbacks
<pie_>
+1
red[evilred] has joined #nixos-chat
<red[evilred]>
anyone here interested in RISCV yet?
<Ashy>
red[evilred]: very yes, but not enough to have bought any hardware yet
<Ashy>
definitely gonna grab some boards when there's linux capable sbcs available at roughly rpi prices
<red[evilred]>
well, theer are some already
<red[evilred]>
not sure how useful they are though
<red[evilred]>
the 1000 core machine though has my attention
<Ashy>
hifive has a couple boards available but they're not high volume prices yet
<Ashy>
is there some others available already?
<red[evilred]>
there probably won't be for a while
<red[evilred]>
I do have it working on qemu though, so that's a start:
<red[evilred]>
Linux foo 5.5.0-0.rc5.git0.1.1.riscv64.fc32.riscv64 #1 SMP Mon Jan 6 17:31:22 UTC 2020 riscv64 riscv64 riscv64 GNU/Linux
<red[evilred]>
now I guess I need to see if I can find a working nixos distro for it
<pie_>
maybe one day nixos will be the first distro to support a platform :P
<tilpner>
gchristensen: Do be careful about using files backed by zfs, to back another zfs pool
<gchristensen>
yeah
<gchristensen>
no good
kalbasit has quit [Remote host closed the connection]
kalbasit has joined #nixos-chat
claudiii has quit [Read error: Connection reset by peer]
sudocurse has quit [Read error: Connection reset by peer]
sudocurse has joined #nixos-chat
claudiii has joined #nixos-chat
<LinuxHackerman>
Ashy: red[evilred]: the pine64 pinecil (soldering iron) is risc-v-based and costs $25 :) that's probably a good platform to play with, though definitely a lot more in the embedded class than the run-linux class
<elvishjerricco>
tilpner: "careful" is an understatement. You should really just never do that at all :P
kalbasit_ has joined #nixos-chat
kalbasit has quit [Ping timeout: 256 seconds]
kalbasit has joined #nixos-chat
kalbasit_ has quit [Ping timeout: 240 seconds]
<tilpner>
elvishjerricco: careful in the sense that it can easily happen without even realising you're doing something unsafe
<tilpner>
You're already running zfs on your workstation, so of course you're going to create the backing files for your pool stability experiment on zfs
KREYREEN has quit [Read error: Connection reset by peer]
KREYREEN has quit [Remote host closed the connection]
<thibm>
Well, today's aoc was definitively the best one so far.
<JJJollyjim>
i learned what a tribonacci is
<thibm>
me too
<thibm>
^^^ SPOILER ^^^ for whoever want to do it !!
<JJJollyjim>
did your input also have no gaps of 2?
<thibm>
I did not check
<thibm>
but the "test" inputs did not have gaps of 2, yep
cole-h has quit [Ping timeout: 265 seconds]
<thibm>
yup, no gaps of 2
<thibm>
my solution is still written in Nix and runs here in 0.09s. Pretty good actually for a tool that was not designed at all for such purpose
<JJJollyjim>
nice
<JJJollyjim>
my girlfriend's one in nodejs runs in 0.05s
<JJJollyjim>
nix >50% as fast as V8 confirmed
<thibm>
well, did she brute force ? :p
<etu>
My bruteforce one that isn't clever in any shape or form that I think is stuck in a loop but I'm busy working has been running for more than 60 minutes :D
<JJJollyjim>
yes haha
<thibm>
brute forced in 0.05s?
<JJJollyjim>
or somewhat broken up brute force
<thibm>
hm
<JJJollyjim>
but it runs in the same time as console.log(a constant)
<thibm>
so nix >50% as fast as V8 if you refine your algorithm :p
<thibm>
etu: it did not finished yet? Are you sure it will finish at some point?
<etu>
thibm: It worked on the example data :D
<thibm>
sure x)
<etu>
I'm sure it's stuck somewhere...
<thibm>
Cause for the first time, the text said "there must be an efficient way to…" ;)
Mic92 has quit [Quit: WeeChat 3.0]
<thibm>
etu:
<etu>
I'm not sure it will finish, but it uses one core on my system so meh 🤷
Mic92 has joined #nixos-chat
<JJJollyjim>
lol
<JJJollyjim>
i love/hate that about modern computers
<thibm>
exactly :D
<JJJollyjim>
something can be stuck in a busy loop forever and you barely notice because it's only a fraction of the total cpu
<etu>
hm, looked at the code for a second
<thibm>
etu: my input has 97 numbers. If all those numbers are 1, there is tribonacci 97 solutions. That is a lot. Like, a lot
<etu>
I just optimized it
<etu>
So now the second example input actually finished in about 1s when I ran it, with the expected result.
<etu>
So I think it actually have a chance to finish with the real input now
<etu>
Still not clever though, but work.
neeasade has quit [Ping timeout: 265 seconds]
<thibm>
I love nixpkgs consistency: builtins.add is put into lib, but not builtins.mul (or builtins.div)
red[evilred] has quit [Quit: Idle timeout reached: 10800s]
waleee-cl has joined #nixos-chat
__monty__ has joined #nixos-chat
<eyJhb>
thibm: It is the great joy
neeasade has joined #nixos-chat
<eyJhb>
Is messenger.com down/not working that well for anybody else?
<eyJhb>
So I have this Cloud VPS module I use, but I want to expand it with multiple providers, but still a easy way to select the size of the VPS, where the main parameters are location, vCPUs, GB RAM and space (I assume fast networking always). Atm. I am thinking of doing a "I want X CPUs but I am OK with it changing a little, X ram, X space" where the "I am OK with change in X, Y and Z" would mean
<eyJhb>
that the implementation would either find the exact match, find something slower (if ok), or find something faster (if strict I need at LEAST this) (e.g. think of DigitalOcean Droplets). Does that make sense, or am I missing something?
<sphalerite>
gchristensen: it's ok, it's in a nixos test. Just that there's a typo….
<gchristensen>
oh okay
<eyJhb>
LinuxHackerman: Yeah, that sounds OK, also something like that I would end up targeting. Should maybe write it down, would be nice to include some cost/benefit on the pricing. But at the end, it should be "tuned" for each provider one uses
<sphalerite>
gchristensen: actually it's worse… that line in the test is incorrect to compensate for a bug in the module
<gchristensen>
wow
<LinuxHackerman>
thanks ma27 I would have preferred to remain ignorant
<ma27[m]>
it's a bug in the module itself and not in the test btw
<hexa->
does that make it better? or just different?
<ma27[m]>
absolutely not.
<hexa->
ma27++
<{^_^}>
ma27's karma got increased to 3
<ma27[m]>
just wanted to provide some context
<gchristensen>
speaking of PRs you definitely do want to review and definitely (fingers crossed behind back) won't find regrettable things in https://github.com/NixOS/nixpkgs/pull/106574
rajivr has quit [Quit: Connection closed for inactivity]
<ldlework>
I can't wait until one day Sean Caroll and Stephen Wolfram realize they're saying the same thing.
clever has quit [Ping timeout: 256 seconds]
<eyJhb>
I am totally new to AWS, but if I want to use this - https://wiki.debian.org/Cloud/AmazonEC2Image/Buster (AMI Name - debian-10-arm64-20201207-477 ) ,when I make a API call to ec2, how should that be specified? Do I need to make another call to get the ID?
<gchristensen>
you need to use the AMI ID not name
<eyJhb>
But based on the name, isn't it possible to get the ID in a way? Instead of having to code it for each region?
<gchristensen>
how are you integrating? with cli? or alang?
<eyJhb>
AWS SDK using Golang
<gchristensen>
ok well I'm not loading that sdk docs page b/c it is too big
<eyJhb>
I was just about to write that...
<eyJhb>
The docs are INSANELY big... And I thought I did not like the nixpkgs/nixos manuals
<eyJhb>
Hmm... I wonder if my instance will ever start :|
<colemickens>
hexa-: (cc:) Mic92 mentioned you might take a pass at fixing HA. It's hacky and I'm busy so I'm just passing this along: https://github.com/colemickens/nixpkgs/commits/cmpkgs there's a few commits, they all mostly concern loosening version ranges.
<eyJhb>
I wonder if I can get it as PDF, and if it would be faster
<hexa->
colemickens: where is the breakage though?
<hexa->
colemickens: I've built hass-nabucasa and the tests run just fine, are you saying they're incomplete?
<hexa->
colemickens: oh, my bad. I'm already in 1.0b4 land :<
<colemickens>
hexa-: if it's easier to fix to go forward instead of patching, I'm certainly not going to complain :)
* colemickens
imagines a nixpkgs-home-assistant where maintainers can do whatever they need to fix ;)
<hexa->
colemickens: next release will be on the 13th
<colemickens>
ack, I'll keep an eye out next week
<hexa->
there is nixpkgs, where anyone can submit anything they'd like fixed … duh
<hexa->
O
<hexa->
I'll look into your changes asap
<colemickens>
I just meant we could do things like skip patching the stable version and just jump to a beta, etc. And I feel weird submitting these point-in-time version constraint hacks to upstream nixpkgs.
<colemickens>
I really don't want to take up time, especially if there's a release in 3 days which is going to include a whole new set of python inter-dependencies.
<clever>
gchristensen: not yet, the power outage murdered my primary switch
<gchristensen>
ouch!
<clever>
gchristensen: the first suspect is actually the UPS, that switch was on a UPS, which has a dying battery
omnd has joined #nixos-chat
lunc has quit [Ping timeout: 265 seconds]
omnd is now known as lunc
<eyJhb>
gchristensen: works now, thanks :) One step closer to implementing it as a provider.
<gchristensen>
nice
<gchristensen>
whatfor?
<eyJhb>
I want to 1. Try to use the spot market 2. Not rely that heavily on DigitalOcean as they have proven time and time again to not be that reliable on their API and random API bans...
<gchristensen>
yeah
<gchristensen>
but also provider for what?
<eyJhb>
gchristensen: Still the CTF/security stuff, I have realised more and more I should just get something up and running, and then I can work on it from there on out. Had a event this week, and people seemed excited to try more challenges
<gchristensen>
ah
<eyJhb>
ANd when using the cloud, you only really pay for what is used anyway.. So 10-15USD a month is OK for me :p
<eyJhb>
Also, on the note on DO. I once found a bug in the API/Backend/Whatever, where I could not create a new Droplet with the same name as a previous deleted Droplet...
<eyJhb>
So it silently would not create, and hung for 1-2 days before I could use that name for a Droplet again........
<eyJhb>
But yeah, hopefully it will be something cool, that some might learn from (not DO, etc. but the platform I want to do)
<colemickens>
Random question for those with more experience using/designing webhooks -- Is it more common to have a webhook sender that allows the payload to be customized, or for the webhook receiver(s) to be purpose-built to receive specific payloads? Or something in between, maybe a service that translates webhook payloads?
<colemickens>
(I'm sitting here with CI_SERVICE that can only send payloads in a specific format, and CHAT_SERVICE that only handles/surfaces payloads with specific fields, wondering if webhooks are even used IRL as service-agnostic).
<joepie91>
colemickens: the latter, receiver purpose-built, when talking about what's common. one particularly interesting approach is for the webhook to solely consist of an opaque identifier, which the recipient then uses to request the actual details of the Thing from the regular API - this also addresses transport encryption concerns
<joepie91>
as the webhook endpoint then does not need to be encrypted
<joepie91>
(which avoids a complicated certificate dance)
<joepie91>
far as I know webhooks are basically entirely vendor-specific in common use, it's not really a standard thing
<joepie91>
all a 'webhook' really is in the end, is a HTTP request in the other direction from usual
<joepie91>
if you are dealing with two sides which both speak their own custom thing and refuse to learn anything else, then I don't see an issue with having an intermediate service translating between the two
<colemickens>
while all of this makes sense, it's very disappointing to someone who naively thought they could "just stick a webhook url in there and be done".
<colemickens>
Even if it was, specify a URL and json string template, that would've been kind of nice?
<joepie91>
nope, unfortunately noone has invented a universal communication protocol yet :P
<joepie91>
though that hasn't stopped people from trying
<colemickens>
idk, but thanks for elaborating joepie91, especially the opaque token bit
<joepie91>
re: JSON templates, that's more complicated than it sounds :)
<colemickens>
yeah, I did sort of realize what I was asking for :P
<joepie91>
structural transformations are difficult to express in a way that humans can still parse them afterwards, see also XSLT
<colemickens>
joepie91: I was thinking more like text-replacement with tokens, and if you specify json, good for you, ha
<joepie91>
yeah but that doesn't account for lists of things, data relations, etc.
* colemickens
nods
<joepie91>
it's the same reason that basically every (HTML) templating library eventually grows an "inline code in $hostLanguage" feature
<colemickens>
It obviously should accept a nix function that returns an attrset that it turns to json :P
<joepie91>
ofc :)
<joepie91>
or maybe Dhall...
<clever>
gchristensen: dead dead, the internal 5v 8a PSU just outputs nothing
<clever>
gchristensen: PR link?
<samueldr>
I'm curious: anyone else having an issue where github started marking all unread issues read automatically?
<joepie91>
can't tell if highlighting clever or expressing it to be clever :)
<sphalerite>
yes.
tilpner has quit [Ping timeout: 260 seconds]
tilpner_ is now known as tilpner
<clever>
gchristensen: what if the autoexpand problem, is because your resizing when zed isnt running?
<gchristensen>
it doesn't auto-expand even at run time afaik
<gchristensen>
like zpool create on another ebs volume, expand the volume -> no auto-expand
evanjs has quit [Ping timeout: 264 seconds]
<ldlework>
what's the word
<ldlework>
when you have a cache
<ldlework>
and you "prime" it
<ldlework>
you prefill it with stuff
<ldlework>
my brain keeps saying "you juice it. you juice the cache!"
<ldlework>
and I'm like god damn it that's definitely not it brain
<sphalerite>
warming it up?
<ldlework>
hmm yeah maybe thats it
<ldlework>
i don't know why my brain thinks water or liquid has to do with it
<sphalerite>
I do like "juice" though.
<ldlework>
like if you have some handle to some resource, when you unserialize that handle you need to "revitalize" it, like hook it back up to the actual resource.
<ldlework>
argh whatever
<adisbladis>
ldlework: I tend to call it warm-up or inject
evanjs has joined #nixos-chat
<sphalerite>
thaw :D
<samueldr>
reticulating splines
<ldlework>
hehe
<ldlework>
rehydrate!
<ldlework>
why seeing "reticulating splines" was the key to unlocking the memory is so mysterious and silly
<ldlework>
s/why/that
<ldlework>
lol juice
<gchristensen>
can I ask journalctl to exclude a service? because wow