gchristensen changed the topic of #nixos-chat to: NixOS but much less topical || https://logs.nix.samueldr.com/nixos-chat
rajivr has joined #nixos-chat
lukegb has quit [Quit: ~~lukegb out~~]
lukegb has joined #nixos-chat
Dotz0cat has joined #nixos-chat
supersandro2000 has quit [Disconnected by services]
supersandro2000 has joined #nixos-chat
<gchristensen> any ZFS users want to tryand dig around in to why zed isn't listening to udev events?
slack1256 has joined #nixos-chat
<infinisil> Still going string with using Nix for advent of code! https://github.com/Infinisil/aoc20/blob/master/8/default.nix
lukegb has quit [Quit: ~~lukegb out~~]
<infinisil> 8 was really fun
<adisbladis> "Still going string" :D
<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
<{^_^}> error: stack overflow (possible infinite recursion)
<infinisil> > iterateUntil (x: x > 100000) (x: x + 1) 0
<{^_^}> 100001
<adisbladis> We should have some builtin for this
<infinisil> Yeah, using foldl' with exponentially increasing list lengths
<infinisil> adisbladis: Agreed
<infinisil> I guess that's pretty much a `while` statement
<infinisil> I wonder if a builtins.iterateUntil would allow us to refactor some lib functions
<adisbladis> infinisil: I spent some time optimising nix-gitignore the other day: https://github.com/NixOS/nixpkgs/pull/106172
<{^_^}> #106172 (by adisbladis, 2 days ago, merged): nix-gitignore: Optimise performance
<adisbladis> I used a similar pattern there
<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
pieguy128 has left #nixos-chat [#nixos-chat]
abathur has quit [Quit: abathur]
slack1256 has quit [Ping timeout: 260 seconds]
endformationage has quit [Quit: WeeChat 2.9]
tilpner_ has joined #nixos-chat
<gchristensen> https://gist.github.com/grahamc/3e09c41e836dc71ee99f8b53c4fd5a2e yay autoexpanding zpools on boot :')
tilpner has quit [Ping timeout: 260 seconds]
tilpner_ is now known as tilpner
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 joined #nixos-chat
kalbasit_ has joined #nixos-chat
kalbasit has quit [Ping timeout: 240 seconds]
supersandro2000 has quit [Quit: The Lounge - https://thelounge.chat]
supersandro2000 has joined #nixos-chat
kalbasit_ has quit [Ping timeout: 240 seconds]
Shados has quit [Quit: Shados]
Shados has joined #nixos-chat
thibm has joined #nixos-chat
lunc has joined #nixos-chat
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?
sphalerite has quit [Quit: brb rebooting]
lukegb has joined #nixos-chat
sphalerite has joined #nixos-chat
slack1256 has joined #nixos-chat
slack1256 has quit [Ping timeout: 260 seconds]
tilpner_ has joined #nixos-chat
tilpner has quit [Ping timeout: 240 seconds]
tilpner_ is now known as tilpner
<infinisil> Github's new dark theme is super dope
<etu> It is!
tilpner_ has joined #nixos-chat
tilpner has quit [Ping timeout: 260 seconds]
tilpner_ is now known as tilpner
skrzyp has joined #nixos-chat
<srk> wow. /me turns of dark reader
<hexa-> it's actually solarized dark
<viric> What is -R${libdir} in pkgconfig?
<viric> my gcc doesn't know -R
lunc has quit [Ping timeout: 265 seconds]
lunc has joined #nixos-chat
kalbasit has joined #nixos-chat
__monty__ has quit [Quit: leaving]
<bbigras> ,locate bin isoinfo
<{^_^}> Found in packages: cdrkit, cdrtools
cole-h has joined #nixos-chat
<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?
neeasade has quit []
<LinuxHackerman> `cat "${./ssh_host_ed25519_key}" > $out/secrets/etc/ssh/sh_host_ed25519_key` 🤔
<LinuxHackerman> eyJhb: how about lower and upper bounds on all the parameters, with the convenience option of target and a ± value as sugar?
<gchristensen> nope............nopenopenope...nope...
<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]> you're welcome linus %)
<hexa-> oh rght
<hexa-> the sh_host_ed25519.key
<hexa-> seen it in some places as well :D
<gchristensen> oh dear.
<ma27[m]> in case someone's wondering what Linus is talking about, feel free to go to https://github.com/NixOS/nixpkgs/pull/102530 and shout at me there
<{^_^}> #102530 (by Ma27, 5 weeks ago, merged): nixos/initrd-network-ssh: fix test
<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
<{^_^}> #106574 (by grahamc, 1 hour ago, open): nixos/amazonImageZfs: init
<hexa-> nixos/amazonImageZfs: init with weirdness
<gchristensen> oh yeah
<gchristensen> I'm not trying to hide any shit :P
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
<gchristensen> https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeImages.html you want to filter on architecture and owner-id at least
<eyJhb> Come back manuals, you are slim and beautiful...
<gchristensen> lol
<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.
<hexa-> nah, it's fine
<hexa-> no reason to leave it broken like this
clever has joined #nixos-chat
clever has joined #nixos-chat
<gchristensen> clever: did you see my PR?
thibm has quit [Quit: WeeChat 2.6]
<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?
<{^_^}> #106574 (by grahamc, 4 hours ago, open): nixos/amazonImageZfs: init
tilpner_ has joined #nixos-chat
<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
<{^_^}> systemd/systemd#2720 (by fsateler, 4 years ago, open): RFE: add NOT operator to journal matching
<energizer> if you use json output you can do it with jq tho
<gchristensen> bummer...
<gchristensen> journalctl -f --output json | jq '(select(._SYSTEMD_UNIT != "hydra-queue-runner.service")) | (select(._SYSTEMD_UNIT != "hydra-notify.service")) | ._SYSTEMD_UNIT + " " + .MESSAGE' not bad though!
<gchristensen> thanks energizer
<energizer> nice one
<infinisil> Ugh, cases are rising again slightly in switzerland, even though we just were over a wave https://paste.infinisil.com/f_hEL9FUuI.png
endformationage has joined #nixos-chat
tilpner has quit [Ping timeout: 258 seconds]
tilpner has joined #nixos-chat
endformationage has quit [Ping timeout: 240 seconds]
red[evilred] has joined #nixos-chat
<red[evilred]> ldlework (IRC) - I use the term "populate"
<red[evilred]> I populate the cache
<ldlework> there were some good terms, but i was definitely trying to "recall" 'hydrate'
<gchristensen> this answer is *insane*: https://stackoverflow.com/a/57520552/637129
abathur has joined #nixos-chat
<colemickens> lol
<drakonis> hydrate is used a lot by php
<drakonis> you'll find it used a lot by php developers
<drakonis> rather than populate
<red[evilred]> coolio
<gchristensen> oh wow thattakesme right back to the Propel ORM
<red[evilred]> "populate" is typically used in systems where you have a known set to populate
<red[evilred]> if that makes sense
<red[evilred]> I'd use "warm" if I was only populating say the most common "x" keys
<red[evilred]> I've abandoned caches in all my designs anyways - so I'm not really tracking the terminology anymore
<adisbladis> gchristensen: Speaking of ORMs, have you seen https://ponyorm.org/
<red[evilred]> (I got anti-cache religion)
<adisbladis> It's pretty wild
<samueldr> ask a squirrel
<samueldr> they know how to cache
<red[evilred]> I'm glad pony is called ponyc in nixpkgs now
<adisbladis> samueldr: They even know how to deal with cache invalidation
<gchristensen> adisbladis: oh neat (though I was expecting it to be ponylang)
rardiol has joined #nixos-chat
endformationage has joined #nixos-chat