gchristensen changed the topic of #nixos-chat to: NixOS but much less topical || https://logs.nix.samueldr.com/nixos-chat
endformationage has joined #nixos-chat
wildtrees has quit [Quit: Leaving]
<gchristensen> anyone want to watch someone practice piano while I try and get A/V working nicely
<jtojnar> sounds great
<gchristensen> [269025.543422] usb 1-9: Not enough bandwidth for new device state.
<gchristensen> ...
<gchristensen> what, this small laptop isn't capable of 2 super high bandwidth devices? :P
<andi-> lol
<gchristensen> thanks for coming jtojnar and andi- :)
<andi-> it was a very welcome change :-)
<gchristensen> =)
<gchristensen> my big 15" laptop is capable of handling the microphone and camera at full quality, which my network isn't good enough to upload afaict
<gchristensen> maybe I will try to broadcast the performance.
<gchristensen> there were two pieces being practiced. I don't know their names, but one was by a Chinese composer and the other by an Italian composer, as a sort of solidarity
ottidmes has joined #nixos-chat
<ottidmes> joepie91: I recently implemented some property based testing for a parser of a wiki language of mine. Made my other unit tests mostly worthless... And it was insane how good it was at finding edge cases I had not thought of.
<ottidmes> One I finally managed to fix all of them, I improved the property based tester further, and it managed to find yet more edge cases...
<joepie91> ottidmes: I don't actually consider automated tests *that* important to reliable software :) but that is an extensive discussion that I don't have the time or energy to go into right now...
<gchristensen> my disposal has picked a delightfully good moment to decide to spew water out the bottem in to my cabinets
<joepie91> gotta sleep in a bit
<ottidmes> joepie91: yeah me too, I think we are in the same timezone, in which we really ought to be sleeping
<cole-h> gchristensen: I missed it! Please ping me next time (if you remember), I'd love to listen to some soothing piano
<gchristensen> cole-h: what is your TZ?
<joepie91> :P
<cole-h> PST or whatever Pacific is rn
<cole-h> PDT, oops
* cole-h was too immersed in his surprisingly on-time Animal Crossing
<gchristensen> cole-h: maybe I can put up a snippet
<cole-h> <3 gchristensen
<{^_^}> gchristensen's karma got increased to 237
<ldlework> Anyone in here study philosophy?
<andi-> Tried another two shops to purchase a webcam from... I could get it in september.. Not really up for waiting that long
<gchristensen> jeeeeeze.
<gchristensen> maybedirect from dell, andi-?
<andi-> alternativ approach is trying to figure out why this notebook is so slow
<ottidmes> Was surprised to see my router arrive in a week from Hong Kong, was expecting much bigger delays with all that is going on
<andi-> gchristensen: maybe, I've spent two evenings browsing shops... kinda lost motivation now
<gchristensen> I don't blame you
<gchristensen> get a thinkpad that folds flat and tape it to the back of your screen
<andi-> Yeah, I have one somewhere around here
abathur has quit [Ping timeout: 265 seconds]
<andi-> rtsp streaming from one computer to the other and then exposing that as a video device...
<andi-> nothing ffmpeg can't do
<gchristensen> there you go lol
<gchristensen> obs-studio has a virtual webcam plugin I've been meaning to package and try
<colemickens> I couldn't get it to build
<colemickens> if it's the same one I was looking at :( I can push it if you want to try
<gchristensen> hrm :/
<colemickens> I put a limited amount of effort into it...
ottidmes has quit [Ping timeout: 250 seconds]
<gchristensen> colemickens: I really want an obsWithPlugins :)
<cole-h> 👀
<gchristensen> cole-h: some nice thank-you's in here https://github.com/CatxFish/obs-v4l2sink/issues
<cole-h> colemickens: ^
<colemickens> oh dang, wow, I think that might've all happened since I tried last.
<gchristensen> oops thanks cole-h :P
<gchristensen> colemickens: I got it to build!
<colemickens> sweet!
<cole-h> 😁
<colemickens> another nixpkgs branch I can delete soon, always a good sign
<gchristensen> it doesn't work though
<cole-h> rofl
<cole-h> gchristensen: Does it work now?
<gchristensen> it dumps core on Stopping
<gchristensen> it is working in a sense, but not working in the sense that it is useful
<cole-h> Nice :P
<gchristensen> ,tofu
<{^_^}> To get a sha256 hash of a new source, you can use the Trust On First Use model: use probably-wrong hash (for example: 0000000000000000000000000000000000000000000000000000) then replace it with the correct hash Nix expected. See: tofu-vim
<gchristensen> ok colemickens here is the deal, you need boot.extraModulePackages = [ pkgs.linuxPackages_latest.v4l2loopback ]; and then like sudo modprobe v4l2loopback exclusive_caps=1 video_nr=9 card_label="obs-output"
<gchristensen> but it crashes on load
waleee-cl has quit [Quit: Connection closed for inactivity]
drakonis has quit [Quit: WeeChat 2.7.1]
<ashkitten> gchristensen: are you planning to pr that plugin to nixpkgs? i'm interested, i just found out about that plugin with a friend who needed it and i figured it'd be nice to have in nixpkgs too
<gchristensen> no
<ashkitten> okay, if you do lmk
<gchristensen> it doesn't work :)
<gchristensen> I mean, I can't make it work
<ashkitten> ah
abathur has joined #nixos-chat
<colemickens> I have most of that already for regular v4l2loopback usage. I'll give your branch a shot.
<gchristensen> it doesn't work for me, I get a lot of kernel errors
abathur has quit [Ping timeout: 240 seconds]
drakonis has joined #nixos-chat
<colemickens> your link earlier didn't work did you actually push the branch
<colemickens> or maybe you have multiple nixpkgs for all i know
<colemickens> er, never mind, I see the branch in your remote
<colemickens> so you created the video dev and then manually configured the output mode to stream/record to it? I guess?
<gchristensen> yeah
<gchristensen> not output mode
<gchristensen> Tools -> v4l2...
<colemickens> unsurprisingly, same results
<colemickens> it is possible to get ffmpeg to push directly to a v4l2loopback device.
<colemickens> I wonder if you can configure OBS-studio in advanced mode to push to it correctly?
<gchristensen> ugh I think the disposal and dishwasherin my kitchen isn't up to code: not using a GFCI outlet
<colemickens> well, I got some output in jitsit.
<colemickens> I didn't do exclusive_caps and chose YUY2.
<colemickens> the output is flipped too, but that might be the application layer.
rardiol has quit [Ping timeout: 250 seconds]
<ashkitten> colemickens: no, you cannot make obs output to v4l2-loopback. it doesn't list the v4l2 container in advanced mode
<ashkitten> i tried messing about with a local udp stream to ffmpeg to v4l2-loopback but it was messy and didn't work right so i gave up. your best bet is to get the obs plugin working.
<ashkitten> or maybe ask in the obs irc channels and see if it's possible to get v4l2 container in obs
<ashkitten> and horizontal flipping is very probably at the application layer in the case of webcams
endformationage has quit [Ping timeout: 264 seconds]
<gchristensen> it would be nice if znapzend didn't send allll the missing snapshots in one go, and instead sent one at a time
<gchristensen> right now it sends foo/bar@{1,2,3} then foo/baz{1,2,3} and I think foo/bar@1, foo/baz@1, foo/bar@2, foo/baz@2, foo/bar@3, foo/baz@3 would be better
<gchristensen> one problem with the current way is is it is bringing a new server up to speed, no new snapshots go out for any other dataset or to any other server
<gchristensen> and again this is easily solved with this strategiy
<etu> Ugh, good morning!
<gchristensen> good night!
<etu> etu's taxi service has to get up
<etu> And pick a person up from the night shift so the person can sleep without exposing herself to public transport
<cole-h> gchristensen: Is that something that could be changed in the tool? That might be something to look into if/when you have time, if this is a recurring problem
<gchristensen> the chances of that percolating to the top half of my to-do list approaches zero :P
<cole-h> Haha, fair enough
<colemickens> Does something like a FUSE projection of password-store exist? I want to be able to specify paths like `/run/password-store/packet.net/apitoken` in my nix config, ship the entire password store in the image and then (let an end user) slip (their) gpg key in at the last second, outside the store and root image?
<gchristensen> encfs?
<colemickens> maybe, I can't really say why I keep defaulting to pass, I don't necessarily love it, I just have a lot there I guess.
<colemickens> but a lot of my "paths" wind up being binary files (crts/keys/etc) rather than stuff I store in password-store anyway.
<colemickens> I'm over thinking it instead of doing it; I should get this working just shoving everything in the store and then go from there.
<colemickens> my plan is to build two images - a rpi4 pxe payload, and a small rpi4-bootable sdcard image which has an initrd that just downloads the payload and pxe-kexec's in the initrd.
<colemickens> Probably heavily borrowing from ye ole nix-tests.
abathur has joined #nixos-chat
abathur has quit [Ping timeout: 250 seconds]
cole-h has quit [Quit: WeeChat 2.7.1]
KeiraT has quit [Ping timeout: 240 seconds]
<colemickens> lmao, DERP servers
KeiraT has joined #nixos-chat
avn has quit [Ping timeout: 264 seconds]
KeiraT has quit [Ping timeout: 240 seconds]
KeiraT has joined #nixos-chat
abathur has joined #nixos-chat
abathur has quit [Ping timeout: 240 seconds]
MichaelRaskin has joined #nixos-chat
MichaelRaskin has quit [Quit: MichaelRaskin]
MichaelRaskin has joined #nixos-chat
<MichaelRaskin> Hmm. Apparently there is a way to break a WiFi connection in such a way that SSH login will go through, but actual SSH seesion will not work
<MichaelRaskin> (HTTPS als works in the process)
Jackneill has joined #nixos-chat
Jackneill has quit [Ping timeout: 240 seconds]
MichaelRaskin has quit [Ping timeout: 246 seconds]
abathur has joined #nixos-chat
abathur has quit [Ping timeout: 246 seconds]
__monty__ has joined #nixos-chat
<sphalerite> gchristensen: is https://gist.github.com/grahamc/cef69ef0869fed90b727e79c12909162 still the state of the art for emacs on wayland?
ottidmes has joined #nixos-chat
avn has joined #nixos-chat
abathur has joined #nixos-chat
Jackneill has joined #nixos-chat
abathur has quit [Ping timeout: 264 seconds]
avn has quit [Quit: Lost terminal]
avn has joined #nixos-chat
waleee-cl has joined #nixos-chat
rardiol has joined #nixos-chat
abathur has joined #nixos-chat
CRTified has quit [Ping timeout: 250 seconds]
<infinisil> Trying to get used to not touching my face, it's surprisingly hard
<monsieurp> buy chloriquinine and call it a day
<clever> infinisil: watch the new mark rober video
<monsieurp> *chloriquine
<infinisil> clever: That's why I'm doing that :)
<infinisil> monsieurp: What for?
<monsieurp> infinisil: curing COVID-19
<infinisil> If you claim that it straight up cures it then you need to provide a source for that
<monsieurp> make sure to read the whole paper
<monsieurp> for a short summary
<infinisil> That does sound pretty good
<monsieurp> yup
<infinisil> monsieurp: Can non-medical people do self-treatment with this though?
<monsieurp> unfortunately the news doesn't make any headlines even this guy is a world-class, top-notch scientist in his field
<monsieurp> the news was even treated as a hoax when it came out about 3 weeks ago
<monsieurp> *even if this
<monsieurp> infinisil: well, probably
<monsieurp> thing is, chloroquine doesn't really cost much and is a well known molecule
<monsieurp> which means Big Pharma won't be able to cash in big bucks on it
<infinisil> If you need an IV to take it, it will only be useful for hospitals
<infinisil> But anyways, it's still much better to not get infected at all
<gchristensen> yes
<infinisil> monsieurp: So about your suggestion of just buying choriquine, I'm not sure if it's a useful one. I probably couldn't administer it properly, and if everybody does it, it could lead to the same problem hospitals currently have with other equipment (they can't get it where it's needed anymore)
<monsieurp> a shortage you mean?
<infinisil> Yea
<infinisil> Maybe it's so abundant that this isn't a problem though
<gchristensen> I doubt it
<monsieurp> infinisil: exactly
<gchristensen> you may have expected toilet paper to be so abundant
<infinisil> ^^
<pie_[bnc]> i saw a headline somewhere about some big pharma donating (citaiton needeD) like 100,000 doses of that or something <monsieurp> which means Big Pharma won't be able to cash in big bucks on it
<pie_[bnc]> massive citation needed because i dont remember any details
<infinisil> Neat
<pie_[bnc]> did not do my research but it sounds early to me, and people are jumping on this because its the only thing / theyll be ahead if it pans out
<pie_[bnc]> guess ill check <monsieurp> https://www.sciencedirect.com/science/article/pii/S0924857920300820 <monsieurp> for a short summary
<pie_[bnc]> anyone watching the lesswrong link list? they seem to have a good link list somewhere, cant place it right now
<pie_[bnc]> i dont have the capacity to keep up with the ncov stuff right now
<eyJhb> Lucky for me I had a big bottle of hand disinfectent from a couple of years ago ! I think around half a liter
<pie_[bnc]> i cut my finger uying moving boxes at the hardware stoyer today
<pie_[bnc]> *store
<pie_[bnc]> couldnt decide if not having disinfectant on hand menas i should suck on my finder or leave it, ened up sucking on my finger. idek.
<pie_[bnc]> ncov isnt widespread here yet by my handwaving estimate, so maybe ill just catch something else
<pie_[bnc]> :I
<pie_[bnc]> my logic: better to have osme stuff in my mouth than already in my bloodstream but honestly, idk
<eyJhb> What about warm water and soup?
<eyJhb> soap* ??
<eyJhb> Half my spelling was muscle memory, and even then it wasn't that good...
<pie_[bnc]> eyJhb: i was in the middle of the hardware store idk :D
<pie_[bnc]> i suppose i could have asked where the bathroom is
<pie_[bnc]> im not used to sticking my fingers in my mouth so that was a weird reaction tbh
<eyJhb> *kinky*
<pie_[bnc]> xD
<pie_[bnc]> "no place to wash hands nearby?" "better stick it in my mouth i guess?"
<eyJhb> Does and don'ts :p
<pie_[bnc]> watch european society collapse because of one thing this man did!
<gchristensen> new hw arrived. first step: open the box outside and wipe down every box on the inside with diluted bleach
vesper11 has quit [Read error: Connection reset by peer]
<eyJhb> If I die from box Corona, then I die from box Corona
vesper11 has joined #nixos-chat
<__monty__> pie_[bnc]: That's really suspect reasoning. It's not as if viruses are strong swimmers and blood usually flows outward. If you ingest it it goes all the way through your intestinal tract, plenty of opportunity to infect.
<__monty__> Not claiming my reasoning isn't suspect btw. Just that it's at least equally valid.
<ottidmes> eyJhb: lol, that was my approach when I got my package from abroad
<pie_[bnc]> __monty__: yeah, dunno.
<eyJhb> ottidmes: shopping would be impossble otherwise... Having to scrub down all items :p
<infinisil> The alternative is to just leave the package sit at home unopened for like 2-3 weeks
<pie_[bnc]> but what about all the corona thats in the chinese air from your package?
<pie_[bnc]> or all the bubblewrapped corona?
<infinisil> I think it only "survives" up to 9 days
Jackneill has quit [Ping timeout: 256 seconds]
Jackneill has joined #nixos-chat
drakonis_ has joined #nixos-chat
drakonis has quit [Ping timeout: 250 seconds]
drakonis_ has quit [Read error: Connection reset by peer]
drakonis has joined #nixos-chat
drakonis_ has joined #nixos-chat
drakonis has quit [Ping timeout: 246 seconds]
endformationage has joined #nixos-chat
<pie_[bnc]> <gwern> I'd still give >50% that hydroxy isn't going to work out the way everyone hopes, and trump is now desperately seizing on them as a silver bullet
<pie_[bnc]> <bot> Donald J. Trump on Twitter: "HYDROXYCHLOROQUINE & AZITHROMYCIN, taken together, have a real chance to be one of the biggest game changers in the history of medicine. The FDA has moved mountains - Thank You! Hopefully they will BOTH (H works better with A, International Journal of Antimicrobial Agents)....." (image: https://pbs.twimg.com/profile_images/874276197357596672/kUuht00m_400x400.jpg)
<pie_[bnc]> <bot> Dr. Edsel Salvana on Twitter: "Please don't take hydroxychloroquine (Plaquenil) plus Azithromycin for #COVID19 UNLESS your doctor prescribes it. Both drugs affect the QT interval of your heart and can lead to arrhythmias and sudden death, especially if you are taking other meds or have a heart condition." (image: https://pbs.twimg.com/profile_images/1223798635030204416/558dH-ik_400x400.jpg)
cole-h has joined #nixos-chat
<colemickens> dear god another press conference today, I can't. I'm going back to bed, I literally just can't.
<pie_[bnc]> x)
<pie_[bnc]> colemickens: just dont look at it
<pie_[bnc]> i occasionally close IRC, can you imagine that?
<cole-h> Wait what? That's possible?
<cole-h> I didn't think you could close IRC 😱
* colemickens nods
<pie_[bnc]> ikr
<aleph-> heh
<colemickens> what room was that from anyway?
drakonis has joined #nixos-chat
wildtrees has joined #nixos-chat
drakonis_ has quit [Ping timeout: 246 seconds]
<pie_[bnc]> <x> > Mozilla has re-enabled TLS 1.0 and 1.1 in the Firefox Stable and Beta browser
<pie_[bnc]> <x> > We reverted the change for an undetermined amount of time to better enable access to critical government sites sharing COVID19 information.
<pie_[bnc]> colemickens: lesswrong
drakonis1 has joined #nixos-chat
drakonis_ has joined #nixos-chat
drakonis has quit [Ping timeout: 246 seconds]
<gchristensen> oh damn, my PSU and this board don't seem to be compatible
<eyJhb> That seems weird, how come gchristensen
<eyJhb> ?
drakonis_ has quit [Ping timeout: 240 seconds]
<pie_[bnc]> <bot> Can Smart Thermometers Track the Spread of the Coronavirus? - The New York Times
<gchristensen> the board wants a 24 pin connector, and the PSU's cable lets me plug in either 18 pins or 28 pins
<pie_[bnc]> i was saying the other day we might as well use ubiqutous tracking for sometihng good for once
<gchristensen> I think :)
<eyJhb> gchristensen: can't it be split up further?
<gchristensen> it doesn't appear to support that, but maybe it can have some pins plugged in and some dangling off the side
<pie_[bnc]> i dont suppose you can check the pinout
<gchristensen> I will have to do so, that is a good idea. I don't want to let out the smoke again
<gchristensen> anyway, I have a disposal arriving so I'd better put this down and come back to it once my kitchen works again :D
<gchristensen> thank you for the ideas!
<pie_[bnc]> \o/
<eyJhb> Seems weird :p
<eyJhb> Throw it at the disposal if it doesn't work ;)
drakonis_ has joined #nixos-chat
aleph- has quit [Ping timeout: 268 seconds]
aleph- has joined #nixos-chat
aleph- has quit [Client Quit]
<gchristensen> okay the answer was sitting right in front of me
<gchristensen> I thought the part with the split end was to support different motherboard configurations, but no -- the part with the split end connects to the psu :) the other end of the cable was 24pin as expected
<__monty__> >.<
<gchristensen> "no I can't fix your computer" just became a lot more real
<samueldr> can't not as in won't, but as in cannot :)
<samueldr> (that's what's up if they run windows or macOS for me)
<gchristensen> not qualified :P
aleph- has joined #nixos-chat
aleph- has quit [Read error: Connection reset by peer]
aleph- has joined #nixos-chat
aleph- has quit [Read error: Connection reset by peer]
lejonet has quit [Ping timeout: 272 seconds]
aleph- has joined #nixos-chat
aleph- has quit [Read error: Connection reset by peer]
aleph- has joined #nixos-chat
aleph- has quit [Client Quit]
aleph- has joined #nixos-chat
<eyJhb> I can, but most people won't pay the price :p
<ottidmes> It's soul crushing work, so it's gonna cost them a soul :P
drakonis1 is now known as drakonis
ixxie has joined #nixos-chat
<gchristensen> wow if I plug my old boot SSD in, the PSU immediately shuts off
<gchristensen> I really put this thing through the ringer
<pie_[bnc]> *wringer
<gchristensen> thanks
<pie_[bnc]> (and it makes more sense that way too!)
<pie_[bnc]> this reminds me of funny things you mishear as a child, but i cant think of any off the top of myhead
<gchristensen> true
<gchristensen> sorta like a mondegreen
<andi-> gchristensen: is there a "graham tries to assemble a computer" stream yet? :P
<gchristensen> LOL.
<andi-> I just spent an hour searching for a mini USB cable... such great legacy technology
<gchristensen> I had to go find a VGA cable, so ...
<andi-> no IPMI?
<gchristensen> well....... I wasn't find it
<andi-> o.O, check your DHCP logs?
<gchristensen> yeah, I didn't see it scroll by
<andi-> meh
<gchristensen> listen, you don't want to know.
<andi-> I also spent some time trying out rt(s)p and mjpeg and raw video and mpegts and … over TCP, UDP, … to get video for calls from another notebook. I guess I"ll just go ahead and forward audio instead
<andi-> NOW I want to know :D
<gchristensen> :D
<gchristensen> okay so apparently I can't use my old cables with this new psu
<gchristensen> <<< NixOS Stage 1 >>>
<ottidmes> andi-: did you try restreamer?
<andi-> ottidmes: not yet, I can do that later
<ottidmes> andi-: had a IP camera, tried setting it up, got it working in VLC, but web players refused to stream my sources, tried restreamer, solved everything immediately... (which was both a good and bad feeling at the same time, good that it finally worked, bad that I would have loved knowing about it earlier, cause the rest was mostly a waste of time)
lassulus has quit [Ping timeout: 272 seconds]
lassulus has joined #nixos-chat
<gchristensen> woohoo I think I've almost got it to work.
<gchristensen> just had to cut some cables...
<cole-h> inb4another fire
<__monty__> Or an explosion because he cut the red wire. Never cut the red wire!
<gchristensen> this one was cutting the 3.3v line on the sata cable to my shucked WD drives :P
<ottidmes> I never got passed the plug and play style of doing hardware, I am already proud of myself that I manage applying cooling paste :P
<gchristensen> "uh oh, half my array didn't come online" "oh I guess it needs power"
<cole-h> haha
<gchristensen> ottidmes: I like to suffer from time to time to remind me how great the cloud is
lejonet has joined #nixos-chat
<ottidmes> gchristensen: lol, I can appreciate it without going through the suffering :P but at least your way you also get more of an understanding
<gchristensen> this makes me sad, I now have nowhere to plug in my Gateway 2000 keyboard anymore
<__monty__> Keyboard with external power?
<__monty__> I thought the array power was because you cut the 3.3V lines.
<gchristensen> I mean I don't have any more systems with a ps/2 port
<__monty__> Oh, derp.
<colemickens> clever: if I understand correctly, not-os will download the rootfs and then exec init from the path pointed by "systemConfig" in the kernel cmdline. Is there any reason that I couldn't pack a cmdline into the squashfs and then read the init= from it? That way the boot part (kernel/initrd) can remain fixed but the init can still derive from the downloaded squashfs?
<clever> colemickens: that could be done
<clever> colemickens: one min
<colemickens> Just in case you're going to show me in not-os, I went ahead and started trying to get a nixos version working, just wanted to validate the idea :)
<colemickens> not that I wouldn't mind that too -- I had actually noticed teh same "optimization" could be made in kexec.nix, where you sort of duplicate determining the cmdline, even though you pack it into the kexec tarball. :)
<clever> colemickens: for the kexec case, its meant to be used on a machine that lacks nix, and will shortly be having / wiped
<clever> colemickens: so the tarball is just blasted all over /nix/store, since your going to format soon anyways
<clever> colemickens: currently, this has no way to add files at a fixed path, so you would have to use wildcards to peek at the contents, and risk getting the wrong name = "init";
<clever> colemickens: it just takes a dumb list of derivations, and includes the closure of everything
* colemickens nods,
<colemickens> I was just looking, I'll probably just re-use make-system-tarball, and pull it apart in initrd
<clever> colemickens: while the tarball one, can create symlinks of a constant name, pointing into the store
<clever> colemickens: i also have a second route i wrote recently
<clever> colemickens: skip stage-1, but still use the initrd
<colemickens> oh!
<clever> colemickens: it puts stage-2-init.sh, at /init, in the initrd
<clever> skip stage 1 entirely, never pivot_root
<clever> the remaining 10%, os restoring the nix state, db.sqlite thinks everything in the store is invalid, and will try to delete itself
<ottidmes> colemickens: I have a bunch of config on this too, stuff to make it easy to kexec, a custom initrd reusing NixOS, mini OS based on the initrd, which I use to unlock my sedutil disks
<clever> ottidmes: did i show you haskell-init already?
<colemickens> ottidmes: where's that at? your github seems to just have nixpkgs?
<ottidmes> clever: you did, which I found to be cool, but I do not really have a use case for it
<colemickens> clever: I'm still digesting, it's a bit over my head still. not sure why I'd want to do that or what that enables for you.
<clever> colemickens: it compresses slightly faster, and gives you 1 less stage while booting
<ottidmes> colemickens: I postponed doing that for some time now, guess I can share some of them now, just a quick scan if I don't have something sensitive in it
<clever> ottidmes: main thing i can see haskell-init being useful for, is to convert all of your shell scripts into a haskell binary, and then use brick (a haskell curses-like lib) to make your UI
<ottidmes> clever: next on my list of such projects is trying to make --show-trace more useful by parsing it and displaying it nicer
<clever> ottidmes: the most confusing thing ive seen about --show-trace, is that its not the reference stack, its the force stack
<clever> ottidmes: so if you do a->b->c->d in your files, but you pass c on to e as a thunk, --show-trace will say e->c->d
<clever> ottidmes: also, you probably havent seen my IFD logging patch yet?
<ottidmes> clever: I cannot make heads of tails of the --show-trace, much preferred how I had them in the past in my custom exception handler in PHP
<ottidmes> haven't seen it, I assume that it tries to change that?
<clever> pie_[bnc]: log-all-ifd does exactly what it says, it just prints a log msg on each IFD instance
<clever> ottidmes: oops, ^
<clever> [clever@amd-nixos:~/iohk/daedalus-ar]$ ~/apps/nix-master/result/bin/nix-instantiate default.nix -A daedalus-bridge
<clever> /home/clever/iohk/daedalus-ar/lib.nix:5:13 depends on /nix/store/2irxc1ax0pacz7cw5k6509v1il189j7b-source.drv via scopedImport
<clever> ottidmes: an example of the output
<clever> 5 iohkNix = import sources.iohk-nix { sourcesOverride = sources; };
<clever> ottidmes: in this case, its fetching something via niv
<gchristensen> andi-: I can't seem to get to the bios setup after installing my LSI SAS expanders
<andi-> gchristensen: noes
<clever> ottidmes: if you pastebin me a --show-trace, i can help you parse it and make sense of how its working
<gchristensen> noes?
m1cr0m4n has joined #nixos-chat
<colemickens> clever: one more q - how do I know that you're booting to stage-2 in that gist you linked me? object = "${eval.system}/init"; ?
<clever> colemickens: eval.system is the derivation that winds up at /run/current-system
<clever> colemickens: ${eval.system}/init then is the "compiled" stage-2-init.sh, that normally lands at /run/current-system/init
<colemickens> Oh, okay, for some reason I assumed the "regular" init was stage1, but I see my mistake. Thanks.
<clever> colemickens: it skips stage1 entirely, stage2 is now /init in the initrd
<clever> ottidmes: starting at the bottom, line 107, something tried to eval builtins.currentSystem
<clever> ottidmes: line 106, that something was pure.nix line 7, so we need to look there first
<clever> ottidmes: can you add pure.nix to the gist?
<ottidmes> clever: give me a second, I am about to push my config which contains the file
<ottidmes> clever: ehm, LICENSE, not thought about that, MIT I guess for a config repo?
<clever> ottidmes: i dont think about that much either
<ottidmes> its config, I am not going to put it in yet
<clever> ottidmes: there is also a shortcut we can take, just look at every line referencing option
<clever> ottidmes: line 99 says while evaluating the option `nixpkgs.system':
<clever> $ vi ~/apps/nixpkgs/nixos/modules/misc/nixpkgs.nix
<clever> $ vi ~/apps/nixpkgs/nixos/lib/eval-config.nix
<clever> 11 { # !!! system can be set modularly, would be nice to remove
<clever> 12 system ? builtins.currentSystem
<clever> 43 nixpkgs.system = lib.mkDefault system;
<clever> ottidmes: there, nixpkgs.system is a thunk, that references builtins.currentSystem
<clever> ottidmes: line 7 of pure.nix then forced the nixpkgs.system thunk, along the stack in the gist
<ottidmes> colemickens: https://github.com/msteen/nixcfg-shared/blob/master/pkgs/mklinuxpba/default.nix (basically a mini OS leveraging NixOS initrd)
<clever> ottidmes: ah, so nixpkgs.system was a thunk, that contained the result of function on line 7 of pure.nix
<clever> ottidmes: and then while evaluating the attribute 'currentSystem' at /nix/store/hvyv8k385snbdp480x8lzny3ldy8s6l4-source/lib/attrsets.nix:194:41:
<clever> was involved in the force-stack
<ottidmes> clever: Thanks! Basically I want you builtin some tool :P but since that is not going to happen, I try to make some tool that approximates what you just did and shows snippets like you did
<clever> 194 nameValuePair = name: value: { inherit name value; };
<clever> while evaluating the attribute 'value.content' at /nix/store/hvyv8k385snbdp480x8lzny3ldy8s6l4-source/lib/modules.nix:564:14:
<clever> and thats likely the internals of the module system, for nixpkgs.system
<clever> ottidmes: it would be less confusing if it was the reference chain, but nix doesnt store that
<clever> ottidmes: also, --show-trace has a mild performance cost, even when not showing a trace
<clever> ottidmes: have you seen how it generates the trace?
<ottidmes> no
<ottidmes> https://github.com/msteen/nixcfg-shared/blob/master/nixpkgs/nixos/default.nix#L8 is what I thought would set nixpkgs.system too
<ottidmes> I am totally fine with the performance cost, since it is like a debug built, not something you use normally
<clever> ottidmes: in the c++ code for calling a nix function, it will check if your using --show-trace
<clever> if you are, it runs the function inside a try/catch block
<clever> when catching a nix Error type, it will append a line to the stack trace, and re-throw the same error
<clever> which gets caught, appends a line, and re-throws
<clever> until the whole c++ stack unwinds
<ottidmes> lol, now wonder it has a performance cost
<clever> ottidmes: if you dont --show-trace, it will tail-call the eval, and make the stack slightly simpler
<clever> so even the non-throwing case is faster
<cole-h> clever: Sorry to intrude, but what does "thunk" mean in this scenario?
<clever> cole-h: its part of how lazy languages work, it references a function thats not yet been evaled
<clever> ottidmes: hmmm, yeah, i would expect line 8 of default.nix to prevent the error...
<clever> ottidmes: maybe set currentSystem to a wonky value? because the module system may force everything before it knows which to keep?
<cole-h> clever++ Thanks for the clarification!
<{^_^}> clever's karma got increased to 354
<ottidmes> Ah, right! clever++
<{^_^}> clever's karma got increased to 355
<clever> cole-h: basically, when you run a nix function on some value, nix doesnt actually run it on the spot, it just creates a thunk, that says "run f on x"
<clever> cole-h: and only when something forces it to stop being lazy, will nix figure out what the answer was
<clever> which may wind up being recursive
<cole-h> Got it.
<clever> cole-h: and --show-trace shows the trace of forcing, not the path a value actually took in the expr files
<cole-h> Yeah, --show-trace is very rarely helpful when I mess things up :P
<ottidmes> clever: for it to do that it would need to track thunk creation and trace how they are passed, mush more complicated than the current trick
<clever> ottidmes: you would probably want to modify the thunk type, and add a Pos to it when created
<clever> then you can show the trace for thunk creation
<clever> which will be where f got called from
<clever> that might be enough to do it all...
<clever> ottidmes: currently, a thunk is 2 pointers, for the Env (vars passed into the function) and the Expr (which function)
<clever> ottidmes: if a 3rd value of type Pos was added, then you could track where a thunk was made...
<clever> ottidmes: and then sites like this, would have to be modified to populate that Pos
<ottidmes> yeah, but that is just a part, evaluation order will remain different than the straightforward stack you get in strict languages
<clever> ottidmes: that would at least tell you where `foo = f x` occured, rather then where `foo` was first forced
vesper11 has quit [Ping timeout: 250 seconds]
<clever> ottidmes: which might solve everything
<ottidmes> true
<ottidmes> how easy is it to get patched through Nix?
<clever> ottidmes: main problem, is that the union in the Value, must always be 2 pointers long
<clever> if you add the Pos, you totally ruin the memory cost for EVERYTHING
m1cr0m4n is now known as m1cr0man
<clever> so you have to add indirection and make one it point to a wider structure, and that then harms cache locality
<ottidmes> well, then we need a debug nix, not to be used in production, but to debug stuff
<clever> yeah, this could be a special compile-time option to nix...
<clever> ghc does the same thing
<ottidmes> painfully aware XD
<ottidmes> let's recompile everything now I want to debug 1 thing
vesper11 has joined #nixos-chat
<clever> ottidmes: basically, every Value in nix, is of the Value type (line 91 of value.hh), which is basically 3 pointers in size, always
<clever> ottidmes: first, you have .type, which is an enum, then you have a 2 pointer-wide union, which part you use, depends on the type
<clever> ottidmes: unlike sum-types in haskell, all versions of Value must be the same size
<ottidmes> seems straight forward
<clever> ottidmes: lists are one of the weird ones
<clever> ottidmes: a list of length1 or length2, are special types, and line 130 will directly point to the 1st and maybe 2nd Value in ram
<ottidmes> I have almost no experience with C++, but some with C, and plenty with other languages, so I should be able to cope creating a few changes with this info
<clever> ottidmes: but a list of any other size, will use line 127-129, which has a size, and a pointer to the 1st element
<clever> so a list of length1 or length2, doesnt require allocating another list for the Value*'s
<ottidmes> makes sense as an optimization
<clever> ottidmes: black-hole is another weird type, that i have also seen in ghc, but less used
<clever> ottidmes: basically, when you try to eval a thunk, nix will temporarily change the type to black-hole, then try to eval it
<clever> ottidmes: and if you come full circle and depend on a black-hole value, you have hit infinite recursion!
<ottidmes> black-hole = undefined?
<clever> youve hit your own tail
<ottidmes> ah like so
<clever> nix is single threaded, so encountering a blackhole is game-over, like that old nokia snake game
<clever> in ghc, it has lazy blackholing, only certain things (in the region of unsafe perform io) create black holes
<clever> so, if 2 threads try to eval the same thunk, there is a chance of them re-computing the same value in parallel
<clever> and then the 2nd one, overwrites the result of the 1st
<clever> but its pure, so they both come to the same answer (in theory)
<clever> but, when you `ghc -j20`, its constantly modifying some things in an MVar
<clever> and then all 20 threads waste cpu re-computing the new value (repeating the same work, in parallel)
<clever> then one of them modifies the MVar, so everybody has to repeat the work again
<clever> and higher amounts of parallism, make ghc slower!
<clever> you can force blackholes, but in ghc, a blackhole is a mutex
<clever> so ghc has to grab a mutex every time it tries to eval a thunk, which is a performance cost
<ottidmes> clever: still could not figure out the missing system though... in nixpkgs/nixos/default.nix I set it explicitly, it should be passed to the checkout of Nixpkgs' nixos/default.nix, and that calls lib/eval-config.nix with that system, that then sets is as nixpkgs.system, which gets passed to nixpkgs.localSystem
<clever> ottidmes: if we look up the stack further, we see line 85, nixpkgs.localSystem
<ottidmes> I noticed that too, yeah, a bit more parallel can helps lots though
<clever> 154 localSystem = mkOption {
<clever> 156 default = { inherit (cfg) system; };
<clever> 6 cfg = config.nixpkgs;
<clever> so it should depend on the value youve set
<clever> while evaluating the attribute 'src' of the derivation 'hsort-0.1.0.0' at /nix/store/hvyv8k385snbdp480x8lzny3ldy8s6l4-source/pkgs/development/haskell-modules/generic-builder.nix:291:3:
<clever> while evaluating the option `environment.variables':
<clever> ottidmes: something in your env vars, depends on hsort?
<clever> while evaluating the option `environment.etc.bashenv.text':
<ottidmes> PATH I guess
<clever> ottidmes: your bashenv ?
<ottidmes> its in systemPackages, nothing more
<clever> while evaluating the attribute 'passAsFile' of the derivation 'system-path' at /nix/store/hvyv8k385snbdp480x8lzny3ldy8s6l4-source/pkgs/build-support/trivial-builders.nix:7:14:
<ottidmes> there you go
<clever> ottidmes: system-path is the derivation for systemPackages
<clever> yep, system-path is one line above hsort
<clever> so bashenv depends on system-path which depends on hsort
<ottidmes> so could it be something completely unrelated to the passing of system directly
<clever> ottidmes: where is hsort added to systemPackages?
__monty__ has quit [Quit: leaving]
ixxie has quit [Ping timeout: 240 seconds]
<ottidmes> in my host config
<clever> ottidmes: can you pastebin that file?
aleph- has quit [Read error: Connection reset by peer]
<ottidmes> guess you are more interested in the overlay, cause the file containing the systemPackages has nothing related to this other than that adding hsort to systemPackages
<clever> ottidmes: its just adding pkgs.hsort?
<ottidmes> jep
aleph- has joined #nixos-chat
<clever> ottidmes: overlay then
<clever> ottidmes: hmmm, that should be fine, nothing is re-importing nixpkgs there
<clever> ottidmes: what about hsort/default.nix?
<clever> while evaluating the attribute 'src' of the derivation 'hsort-0.1.0.0' at /nix/store/hvyv8k385snbdp480x8lzny3ldy8s6l4-source/pkgs/development/haskell-modules/generic-builder.nix:291:3:
<clever> while evaluating anonymous function at /cfg/shared/nixpkgs/default.nix:3:1, called from /admin/proj/haskell/hsort/default.nix:3:7:
<clever> that part looks fishy
<clever> a bit
aleph- has quit [Read error: Connection reset by peer]
<ottidmes> yep, that was it! Damn...
<ottidmes> with (import <nixpkgs> { }).nix-gitignore;
jasongrossman has joined #nixos-chat
<clever> ottidmes: and thats why hsort was in the --show-trace
aleph- has joined #nixos-chat
<clever> ottidmes: and also why i juset unset NIX_PATH when debugging things like this
aleph- has quit [Read error: Connection reset by peer]
<clever> ottidmes: but does pure.nix override import itself?
<clever> ah, i think it does
<ottidmes> it does, learned of scopedImport from you and have been using it extensively in nix-prefetch
obadz has quit [Quit: WeeChat 2.7.1]
<ottidmes> changed it to __nixPath = []; but still no luck, guess I will experiment further, kind of crucial for pure.nix, since its whole point is to find issues like with hsort
<ottidmes> clever++ At least we managed to pin point both issues, thanks!
<{^_^}> clever's karma got increased to 356
<ottidmes> After fixing this, I really want to start working on a nix-trace tool
aleph- has joined #nixos-chat
<ottidmes> Just wondering what language to use, I like to have a nice CLI GUI, but not sure which language has the best libs for this
obadz has joined #nixos-chat
<ottidmes> clever: Found the issue, __nixPath is not in builtins, but top-level, now I get file 'nix/fetchurl.nix' was not found in the Nix search path (add it using $NIX_PATH or -I), at /nix/store/hvyv8k385snbdp480x8lzny3ldy8s6l4-source/pkgs/stdenv/linux/bootstrap-files/i686.nix:2:20, showing it works (and that I probably should be more permissive than [])
<clever> ottidmes: nix needs <nix/fetchurl.nix> to do a lot of internal stuff
<clever> <nix> is within ${nix}/share/nix i think
<clever> and should match the version of nix
<clever> you could just re-add a { prefix = "nix"; path = <nix>; } to the list
<ottidmes> clever: yep planning to trace the default value and see what should be kept
<ottidmes> clever: Awesome! file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I), at /admin/proj/haskell/hsort/default.nix:3:14
jasongrossman has quit [Quit: ERC (IRC client for Emacs 26.3)]
jasongrossman has joined #nixos-chat
<ottidmes> clever: with this I should have recreated --pure-eval without the last item: https://git.sharcnet.ca/nix/nix/commit/d4dcffd64349bb52ad5f1b184bee5cc7c2be73b4
jasongrossman has left #nixos-chat [#nixos-chat]
aleph- has quit [Ping timeout: 240 seconds]
aleph- has joined #nixos-chat
cjpbirkbeck has joined #nixos-chat