gchristensen changed the topic of #nixos-chat to: NixOS but much less topical || https://logs.nix.samueldr.com/nixos-chat
supersandro2000 has quit [Disconnected by services]
supersandro2000 has joined #nixos-chat
<lovesegfault> supersandro2000: You're the fastest reviewer in the west :P
<gchristensen> please don't overwork yourself and burn out, seriously
<lovesegfault> gchristensen++
<{^_^}> gchristensen's karma got decreased to 381
<{^_^}> Wait no, it got *increased* to 383
immae has joined #nixos-chat
rajivr has joined #nixos-chat
aaronjanse has quit [Ping timeout: 244 seconds]
kalbasit_ has quit [Ping timeout: 240 seconds]
aaronjanse has joined #nixos-chat
<ashkitten> hmmmmm
<ashkitten> i should get a pinetime maybe
<ashkitten> i've been wanting to get notifications and stuff on my wrist
<ashkitten> but keeping something like that charged seems like a hassle
<ashkitten> i've been wearing the same watch for most of my life
<samueldr> I have a smartwatch with ~6 days of battery life, though its notifications mirroring thing doesn't really work
<samueldr> I just charge it when I shower
<samueldr> I don't know how long a charge is expected to last on the pinetime
<samueldr> and how long charging it takes
<ashkitten> it's supposed to be a week
<ashkitten> hmm
<ashkitten> i want the pinetime specifically because it's water resistant and i could shower with it like i do my other watch
<ashkitten> it's unfortunate that i'd have to take the pinetime off to charge
<samueldr> that's the only schedule I found out works for charging mine
<ashkitten> yeah...
neeasade has quit [Ping timeout: 260 seconds]
<ashkitten> hmph
<ashkitten> what if the pinetime did wireless charging
<ashkitten> and i could have a wireless charger under my mousepad
<samueldr> wireless charging AFAIK requires close proximity
<samueldr> but that sure would be nice
* samueldr just fixed the notifications
<ashkitten> good job
<samueldr> turns out there was a setting on the watch too
<samueldr> it's now been more than a year since I got it
<ashkitten> i guess i'll just wait until there's a pinetime with wireless charging
<ashkitten> that's when i'll switch to a smartwatch
<samueldr> I had some vague interest in the pine time, but then I remembered how I have all of everything needing my attention
<samueldr> since it doesn't run Linux, there's not much "trivial" interest
<samueldr> I'd be interested in having an AsteroidOS compatible smartwatch to port Mobile NixOS (but for watches) to
<abathur> there was time, I suppose late in the aughts, where I assumed watches would only survive in the form of Rolexesque status symbols
<samueldr> what saved them, abathur, is their proximity to the wearer
<siraben> colemickens: I got my questions about Emacs answered, but not Chromium. What's the wayland-compatible version of Chromium?
<samueldr> so much data to gather
<abathur> nod
<samueldr> but yeah, it looked like it was going to only be a fasion accessory for quite a while
<colemickens> siraben: it's in nixpkgs nixos-unstable now. Test with `chromium --enable-features=UseOzonePlatform --ozone-platform=wayland`
<colemickens> note, if you run Sway, it has also triggered crashes in Sway, for me at least.
<siraben> colemickens: which version of chromium is this? doesn't seem to make a difference with those flags
<colemickens> It crashes before I can open the about :P
<colemickens> ❯ chromium --version
<colemickens> Chromium 87.0.4280.66
<bbigras> I didn't know Pinetime was a thing. Is it out yet or only the dev kit?
<bbigras> > which means that it will ultimately be up to the developers and end-users to determine when they deem the PineTime ready to ship
<{^_^}> undefined variable 'means' at (string):440:7
<colemickens> well, that's what I get. I installed ungoogled-chromium, launched it in wayland mode, changed my scale factor and sway crashed.
<bbigras> :(
* colemickens is going to be a good user and file the bug...
Church- has quit [Read error: Connection reset by peer]
aleph- has joined #nixos-chat
<siraben> colemickens: how recently was wayland support added to nixpkgs?
<siraben> Chromium wayland support*
<colemickens> idk, I think I sent the changes needed for it ahead of time
<colemickens> hard to say since it's not stable
<colemickens> and the flags have changed, etc
<colemickens> I've been poking at it for over a year :|
<siraben> Is it in your dotfiles?
<colemickens> The only chromium that I use is `pkgs.chromium` and I don't run it in wayland mode yet since it's not ready. That's all I know, tbh.
<colemickens> all of my old experiments are long since dead and likely useless
<siraben> Ah
<siraben> Is the purpose of https://github.com/emersion/xdg-desktop-portal-wlr to enable screensharing like on X?
<colemickens> Yes. If you enable the right env vars, Firefox will be able to use that to screenshare under wlroots-compatible compositors.
<colemickens> (GNOME has their own portal, etc.)
<hexa-> colemickens: unfortunately broke on ff83 :<
<hexa-> not sure why
<colemickens> same here, I guess :(
<hexa-> oh, and it's limited to full viewport sharing
<hexa-> kinda meh
<hexa-> but it's a start
* colemickens needs to replace a go module in go.mod, here goes an hour for nothing
<drakonis> hmm
<colemickens> actually, it went well, after I (in)correctly spelled "gray".
<hexa-> stefano zacchiroli on "Towards an Open Data and Open Source Code Scanner"
<hexa-> they registered the swh: proto at iana
<hexa-> from what I can tell for fetching open source software
<samueldr> I know the how may / how much usage in english, but I have a specific question
<samueldr> if you have a countable, but don't give the actual count, you would use "how much", right?
<samueldr> like, I give you a percentage (or rather, the graphical equivalent to the percent)
<infinisil> I think it would be "how many" when you can count it
<samueldr> but it's not giving the count
<samueldr> I guess it could be seen like a bag of marbles
<samueldr> for which you could realistically use how much and how many
<samueldr> and looking around a bit more also tells me that in my case I want to use "how much"
<samueldr> (I'm not asking "how much ____?")
<bbigras> samueldr: you are in Québec city? I think I saw your twitter profile recently.
<samueldr> yep
<samueldr> thus the ambiguity in my english as a second language
<bbigras> I'm in Laval, just north of Montréal.
<samueldr> neat
<samueldr> (I guess the "north of montréal" part wasn't for me :))
<samueldr> unless they opened a Laval south of Montréal
<bbigras> same thing for me. another funny thing is that I use english every single day on the internet. but I only spoke it when I play some multiplayer video games
<samueldr> really here it's a situation where the phrasing is ambiguous, which doesn't help :)
<bbigras> an old habit. I used to live a bit more to the north. I grew up in Bellefeuille. Which is now merged with Saint-Jérôme. famous for its crime rate, its court house, and the prison helicopter escape.
<samueldr> well... a prison doesn't help with all that
<samueldr> also I like how all answers about "how many / how much", in a less ambiguous use, are all "don't use either, just rephrase"
<bbigras> and probably the poor neighbourhoods. Saint-Jérôme is known as a "ville de BS".
endformationage has quit [Quit: WeeChat 2.9]
waleee-cl has quit [Quit: Connection closed for inactivity]
Jackneill has quit [Ping timeout: 246 seconds]
Jackneill has joined #nixos-chat
<supersandro2000> gchristensen: I get way more burnt out by certain stupid games which I honestly should just delete from my disk and throw away the account passwort
<supersandro2000> I don't know what makes me feel so bad about this article https://medium.com/nttlabs/dont-use-host-network-namespace-f548aeeef575
<supersandro2000> its either that I wasted over 3 days trying not to use network host for my DNS server or that Docker really disappoints the longer you use it
<makefu> supersandro2000: the second is the case
<lovesegfault> supersandro2000: the more you use docker the more you dislike it
<eyJhb> I still kinda like Docker :|
<supersandro2000> IPv6, packet sender, weird kernel bugs which should be fixed since years, full disk cause OOM
<supersandro2000> How are they considered viable if they only support IPv6 manually for years? Should change soon ™️ though
<eyJhb> Easy fix supersandro2000 , do not use IPv6, kernel bugs pstt... Life you mean, don't use all the disk!
<eyJhb> Easy fix \s
<eyJhb> SOON?!
<eyJhb> Let me show you something
<supersandro2000> sometimes the machine magically decides that the interface should lose its IPv6
<{^_^}> docker/distribution#3143 (by eyJhb, 33 weeks ago, open): Add pagination on `/v2/<name>/tags/list`
<eyJhb> They are slow as fucking hell.
<eyJhb> They have other weird kinks, but I don't really want to make more PRs for them to ignore. It is such a closed community, that takes forever.
<supersandro2000> I think they need money or developers. They sold there enterprise a while ago.
<eyJhb> Another ping flies by! - They might need both
<eyJhb> But I use Docker quite a lot, I like it fine. But it has a lot of weird stuff
<LinuxHackerman> I quite enjoyed discovering this bug https://github.com/moby/moby/issues/20350
<{^_^}> moby/moby#20350 (by lheckemann, 4 years ago, closed): Garbage on embedded DNS port crashes daemon
<eyJhb> sphalerite: I always get confused about your Github handle...
<LinuxHackerman> eyJhb: why?
<eyJhb> Because when I see `lheckemann` I know that I know who the person is on IRC, but I always have to enter the profile to see who it is... :p
<eyJhb> LinuxHackerman: But it is a nice bug, sounds like a thing. But at least that got fixed.
<LinuxHackerman> aaah
<LinuxHackerman> hehe
<LinuxHackerman> maybe I should change my weechat nick to something similar as well
<eyJhb> Also, it is awesome they complain about people using docker hub, I am guessing it is costly (ressource, cpe, etc. and networking), but the PR I just linked would reduce both........
<eyJhb> LinuxHackerman: Similar to your Github name? Or simular to lheckemann?
<LinuxHackerman> well both
<eyJhb> Because atm, we have talyz , Taneb tazjin. And I still suck at telling them apart...
<LinuxHackerman> Linux Hackerman is similar to my real name Linus Heckemann
<eyJhb> Should still have a vote to change their names :(
<eyJhb> Now I am confused. ffs :(
FRidh has joined #nixos-chat
<LinuxHackerman> sphalerite is my "odd-one-out" name
<eyJhb> Now you stop right now. I just thought I got the hang on it :(
<LinuxHackerman> lheckemann = Linus Heckemann = LinuxHackerman = sphalerite
<LinuxHackerman> = me
<eyJhb> ^ Dual accounting!!! \s :D
<eyJhb> But then, why two? Like, is on of them on your desktop, while the other is phone stuff?
<steveeJ> is anyone interested in discussing one of these topics? (a) is it a good idea to (build an) run a control loop that sits on top of a NixOS cluster configuration and ensures the defined services are up as defined (very similar to what k8s and nomad do but native to Nix modules) (b) could this be used to run a virtualization cluster on NixOS?
<steveeJ> .. or should I just use k8s with the kubevirt addon on NixOS?
<steveeJ> I really don't want to run Proxmox or something similar *under* NixOS because, obviousloy, it's not native to Nix :-D
<LinuxHackerman> eyJhb: sphalerite is weechat, this is Matrix
<eyJhb> *sigh* :(
FRidh has quit [Ping timeout: 272 seconds]
<eyJhb> supersandro2000: Curious, as for me it seemed like you all of the sudden became SUPER active. How long have you been a maintainer/committer for Nixpkgs?
<lukegb> supersandro2000's had the commit bit for... 8 days or so? But has been running nixpkgs-review on a bunch of PRs for a few weeks+ now I think
<eyJhb> Yeah, I just noticed a surge in activity from supersandro2000 , quite nice
<lukegb> Just hoping they don't get burned out too fast :)
<eyJhb> Haven't seen ... I stil suck at this... him/her/it/other before that
<eyJhb> If I had the time, ohhh boooy!
<eyJhb> I should maybe dedicate an hour or two to do such things as well at some point. Just the nixpkgs-review helps a bunch
FRidh has joined #nixos-chat
<eyJhb> Do we actually have something, like a guide or help, for what is good to do regarding PRs, etc.?
cole-h has quit [Ping timeout: 256 seconds]
<bbigras> Is adventofcode.com fun? I'm thinking it might be too easy.
<eyJhb> bbigras: If it is too easy, then you will do them fast. There might always be a possibility, that one learns something new. :D
__monty__ has joined #nixos-chat
<eyJhb> If it is too easy, then it is just a little break, if it is too hard then it is a longer break :p
<bbigras> yeah. tbh the only reason I think it might be too easy is that it could be mean to some people if it goes crazy hard near the end and they invested all that time without being able to finish it.
<eyJhb> True... I am not sure, I have never done them! Might start doing it :)
<lukegb> I think it tends to get harder near the end
<lukegb> If you want an extra challenge, solve them using Nix only? :P
FRidh has quit [Ping timeout: 246 seconds]
<eyJhb> lukegb++ :D adventofcode USING NIX :p
<{^_^}> lukegb's karma got increased to 6
<lukegb> (istr people have done this in the past)
FRidh has joined #nixos-chat
cole-h has joined #nixos-chat
<bbigras> I would fail miserably if I was only using nix. Everything I did yet with nix was so basic (or based on great work from others) that I barely know how it works. Maybe I should check all those nix pills.
thibm has joined #nixos-chat
<bbigras> oh I just saw https://www.qemu-advent-calendar.org/2020/ on hn.
cole-h has quit [Ping timeout: 256 seconds]
red[evilred] has joined #nixos-chat
<red[evilred]> bbigras (IRC): I feel the same way. What seems natural to all these folks is a struggle for me much of the time.
<bbigras> red[evilred]: haha yeah.
<eyJhb> Coooooooool
<Taneb> bbigras: in my experience advent of code starts of really easy and then gets difficult enough I stop bothering ten to fifteen days in
vika_nezrimaya has joined #nixos-chat
<bbigras> Taneb: oh thanks. I wonder if I'll stop bothering because of it being too hard or a mix of being hard and a lack of motivation.
<thibm> Well, I have a Nix solution for the adventofcode day 1
<thibm> It works on the toy example
<thibm> Not sure if that scales well
<eyJhb> Is it pretty thibm ?
<bbigras> I don't event know how I would run nix code. With the repl?
<thibm> eyJhb: it's not perfect (using a list of length 2 for a 2-tuple) but except from that, yeah it's pretty
<thibm> bbigras: either the repl or `nix-instantiate --eval`
<bbigras> thanks :)
<thibm> The latter let you run nix code without instantiation of store derivations
<thibm> so no more "error: expression does not evaluate to a derivation (or a set or list of those)" ;)
<thibm> I register to see the real input
<bbigras> I know some of those words.
<thibm> ?
<thibm> haha
<bbigras> I mean I'm still confused by how derivation works.
<thibm> Maybe you should check all those nix pills ;)
<thibm> Or not, depending on your goals
<bbigras> I maintain some packages and modules but yeah I should.
<bbigras> I surely read about that sometimes but not enough to remember
<thibm> It worked!
<thibm> To remember you should practice
<thibm> If you don't have good reasons to practice, you forget about it
<thibm> Let's try part 2.
<bbigras> yeah. it's not like a programming language that I use every day.
<thibm> Yeah, that's why
<thibm> I'm using almost every day
<thibm> (And still learning almost every day ;))
<bbigras> well the learning part is true even with programming language that we already master.
<bbigras> maybe I should have said "master"
ece has quit [Read error: Connection reset by peer]
evalexpr has joined #nixos-chat
ece has joined #nixos-chat
<thibm> part2 AoC: error: stack overflow (possible infinite recursion) :<
<thibm> I should rise the stack size
<thibm> It worked! I admit that playing with `ulimit` for a toy program dealing with three lists is not really user-friendly ;)
<thibm> no tail call optimisation in Nix I presume
<thibm> OK then I'll try to do all the Advent of Code in Nix. Not sure how many days it will last ;)
<bbigras> hehe. nice
<eyJhb> thibm: I want to see it! :D
<thibm> :w
<thibm> oops
<thibm> Well now all of you guessed I'm an avid emacs user x)
<thibm> Is it OK to share aoc code?
<__monty__> infinisil: Is there a way to search through all the bot's defined knowledge bits?
<ar> x/35
<__monty__> thibm: Only if you apply a royal amount of SPOILER WARNINGS, imo.
<thibm> OK
<FireFly> oh solving aoc problems in nix sounds fun :p
<thibm> It is
<__monty__> Hmm, nix clearly attracts a rare breed of masochist... : D
<thibm> But it needed 7 seconds to run #1 part 2
<thibm> So I'm a bit afraid for the next days.
<FireFly> __monty__: :p
<thibm> Well, except parsing. It's not fun in Nix
<__monty__> ,aoc = Join us in the Advent of Code. We need your help, Santa's in trouble! #nixos leaderboard: 397598-41437759 https://adventofcode.com
<{^_^}> aoc defined
<eyJhb> thibm: You can just PM it :p
<thibm> That isn't a recognized sponsor join code. :<
<__monty__> I'm not a sponsor. But you should still be able to join the leaderboard?
<thibm> Ah it was the sponsor entry.
<eyJhb> I could join it?
<Taneb> __monty__: is it OK to join if I'm not writing my solution in the nix language? :P
<__monty__> Taneb: Yes! No rules.
<eyJhb> Am I weird for liking the site style?
<__monty__> Well, except for the AoC rules, of course, no cheating!
<__monty__> Everyone can join!
<thibm> joined
<thibm> "day 1 is worth no points" :<
<thibm> On the other hand, that was too easy
<eyJhb> Even in Nix? :p
<thibm> Yep
<thibm> Really too easy then x)
<eyJhb> Way to give a man anxiety! :( :p
<thibm> Sorry ;)
<Taneb> I did it early enough that they gave me points and then took them away :(
<thibm> I should not have said that. It really depends on your background in CS, your skills in Nix, etc
<eyJhb> Wondering, not because my spelling is getting worse or anything. Anyone using a spell checker for Weechat?
<thibm> It was something that fits really well in functionnal programming style, so quite easy in Nix
<thibm> eyJhb: I used to but it's broken now. I should fix it
<eyJhb> Seems like it should be quite doable, however want to make a little "I have done these two before", but not sure how much time that would save, as addition is quite straght forward operation
<bbigras> I saw people sharing aoc code before but I think they did it after the thing was over
<eyJhb> thibm: Maybe it should be added to WeechatScripts
<eyJhb> I also want vimode in there
<thibm> eyJhb: I don't remember. That was years ago
<eyJhb> And maybe my little... emoji to ascii
<thibm> bbigras: yeah I'm not really comfortable with sharing it (not here, but on Internet). But on the other hand, people stealing solutions miss all the fun, I don't really care
<bbigras> yeah
<eyJhb> But maybe we will pastebin it randomly!
<thibm> Did I just used nix-instantiate as a shebang to "run a .nix file" ? Yes :D
<LinuxHackerman> thibm: oh yeah that's the best. nix-build is nice too
<thibm> Nice, I never did that
<eyJhb> I use nix so rarely standalone like that, that I have never gotten the hang on any of them
<thibm> Nobody does I think :)
<LinuxHackerman> I do, I do!
<thibm> Do you have a real live example? (Not the code. The use case)
<infinisil> ,commands
<infinisil> __monty__: ^ currently the only "search" (with Ctrl-F)
piegames1 has left #nixos-chat ["WeeChat 2.9"]
<LinuxHackerman> thibm: I wrote some expressions that produce a variety of nixos disk images and made them executable with a shebang
<LinuxHackerman> I mean, it's definitely a weird way to do it and I wouldn't recommend it for general use just because it breaks everyone's expectations :p
<thibm> With "standalone" Nix expressions?
<sphalerite> yeah
<sphalerite> ./kexec-image.nix → spits out path to the built image
<eyJhb> You cannot just do that sphalerite ! :p Changing nicks mid convo
<__monty__> infinisil: Thanks.
sphalerite is now known as L1nuxH4ckerm4n
<L1nuxH4ckerm4n> eyJhb: is this…
<LinuxHackerman> eyJhb: … better?
<eyJhb> Hmm... I somewhat prefer your sphalerite (not meant in a mean way), I however have no clue if sphalerite has any meaning?
<L1nuxH4ckerm4n> it's a shiny rock
<thibm> Do we have a way to evaluate a string as a nix expression without IFD?
<L1nuxH4ckerm4n> an ore from which zinc is extracted, iirc.
<L1nuxH4ckerm4n> thibm: import :p
<thibm> from a string, not a file
<L1nuxH4ckerm4n> thibm: not arbitrary strings AFAIK.
<thibm> :(
<eyJhb> True, wondered if there was more to it :p But LinuxHackerman and L1nuxH4ckerm4n ... Those are hard to know which is which. :D Why not use weechat-matrix, and then use sphalerite both places! :p
L1nuxH4ckerm4n is now known as sphalerite
<LinuxHackerman> eyJhb: you don't need to know which is which! They're both me!
<eyJhb> ,LinuxHackerman = sphalerite
<{^_^}> linuxhackerman defined
<eyJhb> Perfect.
<eyJhb> We can do full circle here
<eyJhb> ,LinuxHackerman = sphalerite = lheckemann
<{^_^}> linuxhackerman redefined, was defined as sphalerite
<eyJhb> Better..
<thibm> eyJhb: here's the code for day 1 (SPOILER: don't look if you participate) https://git.sr.ht/~thibautmarty/aoc2020
<FireFly> I need to do day1 part2, that seems a bit trickier to do as a derivation :p
<thibm> did you part 1 as a derivation?
<FireFly> yeah
<thibm> What does that mean? (it can means a lot of things)
<etu> thibm: Oh, in nix. I did day1 in nix last year :D
<thibm> I see on the aoc website that I participated in 2015, the first year. I completly forgot about that x). But I did not participate since
<thibm> etu: I think next days will be much harder to write in Nix
<etu> thibm: yeah, it usually is
<thibm> It's already struggling to parse a list of number… and that's just parsing
FRidh has quit [Ping timeout: 246 seconds]
FRidh has joined #nixos-chat
<etu> thibm: You could avoid the ifd you got there by stealing some of my day1 from last year: https://git.elis.nu/etu/aoc2019/src/branch/master/day1/puzzle1.nix#L4-L8
<thibm> cool, thanks
<FireFly> thibm: well I mean, solving it in nix (and I guess expressing the result as a derivation since that seemed like the easiest way to produce a result :p)
<thibm> etu: I was thinking about something like that but I didn't find the splitString function
<thibm> That will be useful for next days
<eyJhb> Thanks thibm :D
<thibm> FireFly: you can `nix-instantiate --eval` to produce a result that is not a derivation
<thibm> my solutions are in Nix, but without derivation
<thibm> (well, except for parsing, it's hacky)
<FireFly> for the parsing I just decided it's fair game to use nixpkgs' lib utilities since it's not terribly fun to reimplement anyway
<FireFly> thibm: hmm fair point
<thibm> yeah I used the lib too
<sphalerite> anyone know how to check if openssl can use and is using hardware acceleration for various algorithms?
<eyJhb> sphalerite: `openssl engine -t -c` ?
<sphalerite> eyJhb: hm, ok, only "RAND" is listed as a capability… Should the CPU's AES support show up there as well?
<adisbladis> sphalerite: I don't think you can do that
<adisbladis> sphalerite: For AES specifically https://stackoverflow.com/a/28614159
<adisbladis> (havent tested)
<FireFly> "Edit: With a suggestion from a colleague I got it down from 30mins to 35s. I can live with that." oh dear :p
<FireFly> I need to do part 2..
<thibm> I was thinking than my 7 seconds solution was already too long
<thibm> Apparently it's not compared to some others x)
<thibm> Apart from that, I find the Nix solution much more elegant and consise than most solutions in that thread.
<etu> thibm: Nix can be super elegant :)
<etu> I quite often miss features from nix when I write other langugaes
<thibm> All the times
<insep_> i wrote my solution in d
<eyJhb> Brainfuck anyone?
<insep_> definitely not the most effective lol
<etu> eyJhb: Feel free ;)
<insep_> oh i would like to see solution in bf
<eyJhb> After work :D
<thibm> It's definitively doable in brainfuck
<eyJhb> thibm: go go! :D
<thibm> I have to work D:
<adisbladis> etu: I did day 1 in Nix :)
<eyJhb> thibm: Always the damn work :(
<eyJhb> adisbladis: compare it with thibm ! :D
<adisbladis> It has terrible complexity, but I don't care
<adisbladis> thibm: http://ix.io/2G99/nix
<adisbladis> Where is yours?
<insep_> here's mine, takes ~77ms to run
<insep_> and that's slow :(
<thibm> It's basically the same
<thibm> But I'm computing the product in a lazy list (at least, I hope so :p)
<thibm> So I find it a bit more elegant. But, I'm not objective of course ;)
<thibm> adisbladis: https://git.sr.ht/~thibautmarty/aoc2020/tree/master/1a.nix for part 1 (your link is for part 1)
<adisbladis> thibm: I get infinite recursion with your one
<thibm> adisbladis: yeah but not
<thibm> you just need to raise the stack size limit
<thibm> ulimit -s 65536
<thibm> for part 2 you get a list of size 200^3
<adisbladis> thibm: Hm, we may have found a place to improve performance in lib ;)
<thibm> adisbladis: I'd say it's tail call optimisation
<adisbladis> I missed that there is a part 2 :P
<thibm> (but I didn't really think about it)
<insep_> got my solution to run in 42ms by adding -O3 :D
<thibm> adisbladis: do it and tell me if you get a false-infinite reduction
* andi- hides as spoilers are being exchanged
<thibm> adisbladis: join the leaderboard
<thibm> ,adventofcode
<thibm> ,aoc
<{^_^}> Join us in the Advent of Code. We need your help, Santa's in trouble! #nixos leaderboard: 397598-41437759 https://adventofcode.com
<thibm> insep_ too
<thibm> I mean, if you want to
<adisbladis> thibm: Nah, I'm not gonna finish this
<adisbladis> I'll usually go to day 3 or something and get bored of it
<thibm> Doesn't matter. But, as you wish
* etu just joined the leaderboard
<etu> adisbladis: That's usually how I roll as well :D
<insep_> oh neat, i'm a part of 2 leaderboards at the same time :D
<etu> yes
<etu> You can join many private ones
<thibm> Yes, it's "private leaderboard" so you can join several ones
* etu is on 5 leaderboards
<eyJhb> Using category- or category/ for putting "a lot" (40 folders) into a order?
red[evilred] has quit [Quit: Idle timeout reached: 10800s]
<eyJhb> Sorting, organising, whatever
<thibm> Sad, lib.findFirst is actually a wrapper around lib.filter + lib.head. I thought it was optimised (can stop iterating/recursing over the list on the first match)
<thibm> Not sure if we can express that in Nix though
<thibm> Hm, that can work well with lazy evaluation
<thibm> eyJhb: I'd say category/. Use the hierarchy for hierarchical stuff
<eyJhb> thibm: Ended up doing that :D
<eyJhb> However, a nix-build later, and they are flat :p But that is OK
FRidh has quit [Ping timeout: 256 seconds]
FRidh has joined #nixos-chat
KREYREEN has quit [Remote host closed the connection]
KREYREEN has joined #nixos-chat
<eyJhb> Watching this https://youtu.be/L6_zYVNqdVU?t=1701 , I still fail to see why there is a need to carry guns in public like so
<sphalerite> thibm: yeah lib.filter + lib.head should be fine because laziness.
<infinisil> thibm: sphalerite: Unfortunately lib.filter is pretty much strict
<infinisil> > head (filter (x: true) [ 0 (throw "nope") ])
<{^_^}> 0
<infinisil> Oh
<infinisil> > head (filter (x: x >= 0) [ 0 (throw "nope") ])
<{^_^}> nope
<infinisil> Yea
<infinisil> However something like https://github.com/NixOS/nix/pull/4154 could actually be implemented for lists as well, which could make them much lazier :D
<{^_^}> nix#4154 (by Infinisil, 6 weeks ago, open): [WIP] Lazy attribute names
<infinisil> Oh, but findFirst could actually be implemented a bit more lazily
<thibm> Yeah I was a bit disappointed by the implementation. But I'm not confortable with list in Nix (I'm used to cons operator and pattern matching)
<LinuxHackerman> oh damn
<infinisil> Yeah lists are a bit different in Nix, they're just arrays. Prepending an element with `[ el ] ++ list` just creates a new list, copying all old elements into it
<infinisil> Similarly, `lib.tail` is expensive because it creates a new array just one shorter
<LinuxHackerman> well if it's an array, that one doesn't even need to be expensive >.<
<thibm> [x] ++ … looks wrong for any FP programmer
<sphalerite> let cons = x: xs: [x] ++ xz
<sphalerite> there you go :p
<sphalerite> uuuh minus typos
<thibm> hiding the dirt :p
<infinisil> I've previously played around with implementing efficient prepend within Nix by using something like a tree representation of attribute sets which gets flattened occasionally
<infinisil> I mean you can just do `cons = x: xs: { inherit x xs; }` and implement custom list operations on top actually
<infinisil> Then it works the same as haskell's lists
<thibm> this looks right to any FP programmer I guess
matthewcroughan_ has quit [Remote host closed the connection]
matthewcroughan has joined #nixos-chat
<__monty__> infinisil: is there a way to alias ,definitions?
FRidh has quit [Ping timeout: 256 seconds]
<infinisil> Nope
FRidh has joined #nixos-chat
<__monty__> ,adventofcode = Join us in the Advent of Code. We need your help, Santa's in trouble! #ranger/#nixos leaderboard: 397598-41437759 https://adventofcode.com
<{^_^}> adventofcode defined
<__monty__> Ugh, they're already out of sync >.<
<__monty__> ¯\_(ツ)_/¯
<infinisil> At some point I should probably implement ,commands with Nix itself
<infinisil> So `,foo = foo` is just an alias for something like `> commands.foo = "foo"`
<infinisil> And `,foo` for `> commands.foo`
<infinisil> Then aliases could be made with `> commands.bar = commands.foo`
<__monty__> ,__mult = something
<{^_^}> __mult defined
<__monty__> Woops, was only trying to get the joke across >.<
<infinisil> Hehe
* lukegb defines commands.__functor
crazazy has joined #nixos-chat
<crazazy> ok so I finished day 1 of AoC written in nix https://github.com/crazazy/aoc2020
crazazy[m] has joined #nixos-chat
<thibm> huhu you're not alone to tried that :)
<thibm> ,aoc
<{^_^}> Join us in the Advent of Code. We need your help, Santa's in trouble! #nixos leaderboard: 397598-41437759 https://adventofcode.com
FRidh has quit [Ping timeout: 260 seconds]
FRidh has joined #nixos-chat
crazazy has quit [Quit: leaving]
KREYREEN has quit [Remote host closed the connection]
red[evilred] has joined #nixos-chat
<red[evilred]> niiice crazazy[m] (IRC) - bookmarking that. I suspect that will end up being a rosetta-stone type resource for me over time
<red[evilred]> Thank You!
<thibm> crazazy[m]: I think has much better complexity than mine
<thibm> it's harder to read
<thibm> It's a bit easy that the input size does not prevent one to get the result with a naive algorithm.
KREYREEN has joined #nixos-chat
endformationage has joined #nixos-chat
mtr has joined #nixos-chat
waleee-cl has joined #nixos-chat
FRidh has quit [Ping timeout: 240 seconds]
<crazazy[m]> nix was absolutely struggling on part 2 with the naive algorithm, so I had to optimize there
<crazazy[m]> so now it just cuts out the number sets that have a sum > 2020
<crazazy[m]> which reduces the problem space
<thibm> struggling with stack overflow? :)
<crazazy[m]> that too
<mtr> I think Nix can handle about 15000 stack frames, at least from what I've seen
<thibm> too? What was the other problem(s) then?
<crazazy[m]> its slow
<crazazy[m]> and you can't kill it with Ctrl-C
<thibm> mtr: I needed ~8000000 recursive calls :p
<lukegb> what about Ctrl-\
<thibm> crazazy[m]: slow how? With the naive algorithm mine runs in a few secnods
<crazazy[m]> maybe I'm just impatient
<thibm> huhu
<crazazy[m]> maybe my computer is just not that good
kalbasit has joined #nixos-chat
<pie_> red[evilred]: its probably a terribly idea. im strongly considering prototyping something with erlang but none of us know erlang. any insight into how long it could take to get into a state where we can mostly manage?
<gchristensen> https://learnyousomeerlang.com/ it is fun
<pie_> gchristensen: the actor model sounds great nd intuitive
<pie_> i was looking at joe armstrongs book actually
<drakonis> elixir is also pretty great.
<infinisil> >> simpson | "What is an ocean, but a multitude of raindrops?"
<infinisil> Is that true though? Was every part of the ocean once a raindrop?
<V> the concept of a raindrop implies gravity exists, which probably did not initially exist
<gchristensen> isn't most water, at this point, dinosaur pee, too?
<infinisil> V: I think it did
<pie_> V: consider: raindrops have their own gravity
<nicolas[m]> hopefully if more people start using Erlang with Nix the tooling will improve!
<V> infinisil: well, assuming that the water was not initially part of the earth, that is
<pie_> nicolas[m]: the problem is im the tech lead and the other people are all webpoop x)
<V> thus, no earth to be rained upon
<pie_> nicolas[m]: the though of "what if i make them try purescript or typescript or whichever" flitted through my head
vika_nezrimaya has quit [Remote host closed the connection]
<infinisil> Now wondering how water even got on earth
<pie_> infinisil: hydrogen, its everywhere
<pie_> you get oxygen from stellar fusion (i think)
<infinisil> Ah!
<infinisil> Of course
<infinisil> It's like one of the simplest molecules
<pie_> sooooo maybe youd have to have some star explosion to get the oxygen out there?
<V> infinisil: yup
<V> hence why it's so abundant
<nicolas[m]> Getting a frontend team on board with typescript will be much easier than Erlang/Elixir
<pie_> well, its somehing like, theres 4 or us, 3 of which do js stuff, and 3 of which (mi included) are AFAIU jack of all trades-ish
<infinisil> V: Well on most other planets at least there's not a lot of water
<infinisil> But I guess hydrogen and oxygen just reacted with other elements to form non-water things
<pie_> so one of the question is going to be who and how much is going to be working on the core
<nicolas[m]> or "who's going to have the biggest bus-factor"
<V> infinisil: there's a lot of hydrogen and methane and such
<pie_> nicolas[m]: what i think we will probably do is try to get minimal prototype 0 done in stuff people know, and then try to introduce a tech stack improvement for prototype 1
<__monty__> How would explosions lead to oxygen I wonder? They're notorious for consuming oxygen.
<V> infinisil: the planets closest the the sun had it boiled off, anything big is going to just be gas, the far away planets are ice (may or may not contain water)
<__monty__> Maybe the oxygen only formed after sporadic fission post-explosion?
<V> moons are probably more likely to contain water in the more distant planets
<infinisil> V: Even if boiled off though, wouldn't it be still in the atmosphere?
<V> obviously hydrogen is more common than oxygen
<infinisil> (assuming it didn't react with anything else, which it probably did)
<pie_> nicolas[m]: well, me and the other guy are the core devs, if we get the grant tjhhe project is 6 months, the bus factor is pretty iffy all around
<V> infinisil: uh, that assumes the planets were large enough/had strong enough gravity to hold it
<infinisil> > escape_velocity_of_venus
<{^_^}> undefined variable 'escape_velocity_of_venus' at (string):440:1
<infinisil> That would've been a bit easy
<V> clearly we need WA integration for {^_^}
<pie_> __monty__: i dont know if you just get random fission and fusion like that. afaiu iron is at the bottom of the parabola-like potential energy curve, so lighter elements fuse and heavier elements fission towards iron's mass
<pie_> probably worth trying to search wiki for something like stellar oxygen formation or something, or maybe the page for oxygen says something
<pie_> nicolas[m]: this is my first project like this, fwiw
<__monty__> pie_: Very rude to return a nerd-snipe >: o
<pie_> nicolas[m]: "oh shit i just put myself in charge of 3 other people"
<pie_> __monty__: :PP
<pie_> __monty__: im just making this up as i go but i imagine most of space is pretty low energy except for some cosmic rays / high energy photons here and there, so i wouldnt expect a lot of fission/fusion events that doesnt involve stuff like stars or nebula, but idunno
<gchristensen> I wonder what things I have that could be reimplemented as a lambda function
<__monty__> gchristensen: Hmm, I don't think there's any that couldn't, technically.
<bbigras> aws lambda?
rajivr has quit [Quit: Connection closed for inactivity]
<gchristensen> well r13y would probably not be appropriate for lambda
<gchristensen> it has a pretty tight limit of memory and cpu time afaik
<pie_> nicolas[m]: probably noone will be able to work on this full time, but if it takes us a month to learn erlang, but means we have less problems, it might be worth it
<pie_> for some value of "learn erlang"...
<gchristensen> fwiw erlang isn't a magic bullet
<hexa-> btw: we've just passed 256k commits
<pie_> yeah
<gchristensen> nice!
<pie_> hexa-: nice
<pie_> well, i guess what needs to happen is i need to look at it for a week or something and see what we can do..
<pie_> problem is stheres too many thigns i need to look at for a week and see what we can do xD
<nicolas[m]> pie_: not sure about the "less problems" part
<nicolas[m]> depending on your Erlang use-case, there is a lot of tweaking to be done to the VM
<pie_> we dont need performance (afaik)
<pie_> its a desktop learning app
<pie_> s/afaik/afaict
<nicolas[m]> great, because it's not one of Erlang's strong point
<drakonis> erlang does not do compute
<pie_> i imagine for perf youd do something like those foreign module thingies with rust
<nicolas[m]> though Erlang now has a JIT compiler
<pie_> so im not really doing distsys (at least in this iteration), but the idea is the actor model will make design easier and we can have explicit protocols between components and such, and that that will also make testing easier
<pie_> i need to figure out how to allocate myself between helping the team doing prototype zero (and have them understand what we are trying to do) with the tech they know, and me figuring tech stack stuff out for prototype 1 , or something like that
<pie_> its also possible to just abandon the tech stack improvement idea but id like to avoid that if feasible..
<pie_> and then i actually have to manage the team and maybe the rest of the administrative stuff (maybe not that much?)
<pie_> and then i probably also have to do the initial infrastructure setup
<pie_> im not sure what from this i can delegate...
<__monty__> Anyone ever been tracking a package and after X times the site suddenly says your tracking code is incorrect?
<eyJhb> Maybe they wanted it more?
<eyJhb> But that sounds weird yeah
<gchristensen> I'd chalk it up to databases are hard
<eyJhb> ^^
<eyJhb> Mine is just doing nothing for some reason :(
<eyJhb> __monty__: who is sending it/where is it from?
<__monty__> eyJhb: I am sending it.
<pie_> turns out my co-developer is familiar with FP
<pie_> thats a big sigh of relief out of me right there
<pie_> soon: NixOS
<etu> Hmm
<V> at which point does NixOS become a cult
<V> and is it one already
<pie_> you mean it isnt already?
<etu> Is there a way to use niv to pin the "channel" you use? Like the main channel?
<pie_> :P
<gchristensen> V: I'd say as soon as the justification for its way of working is surrounded by mystery, and not good ideas and good engineering
<V> gchristensen: are you sure the documentation is good enough for that to be the case? :p
<gchristensen> cults are good at communicating and persuading
<gchristensen> we're not, clearly not a cult
<V> does that make Arch a cult
<gchristensen> I don't like to speak badly towards other tools and distros
<V> I don't consider cult to be a negative term, although I realise other people might draw other connotations
<hexa-> is rust a cult?
<hexa-> or is it a religion?
<V> e.g. religion is the most socially acceptable cult
<gchristensen> the value proposition of Arch is not clear to me
<V> FWIW Arch is my preferred non-declarative distro, the documentation is unbeatable and it's very easy to throw together a setup
<bbigras> maybe people would find arch and rust less culty if they stopped caring about social media sites like reddit and hn.
<V> I just can't stand using it any more due to statefulness & the difficulty of doing source-based packages
<gchristensen> their docs are my most used docs for linux, indeed
<bbigras> I'm not a fan of Arch's AUR not being an official thing and if you have any problem with an update you are fucked.
<hexa-> also I you need perl from AUR you are likely fckd
<hexa-> because resolving perl dependencies within AUR is a shitty experience
<V> like the entire source/binary package management divide is an issue. I think it would be easier if you have a box configured specifically to run a custom repo and build stuff automatically, but that's a lot of effort
<V> I never ended up doing that, just used AUR helpers and prayed instead of pacman directly
<hexa-> i started something like this a few years ago
<V> with NixOS I just get that for free
<hexa-> we planned dependency resolution, but before that happend I was jumping ship for NixOS
<__monty__> Arch ships a broken haskell setup. They package dynamically linked libraries but a GHC that statically links. Those don't go together. They have refused to fix it for well over a year now. It's what drove me to nix. So I guess I'm glad about their position on this.
<V> oops. I didn't mean to start a "bitching about Arch" conversation
<lukegb> hexa-: oh hey, I implemented the same thing
<lukegb> but on top of Google Cloud Build + GCS + [...]
<lukegb> it was CLOUD
<hexa-> lmao
<lukegb> push repo of PKGBUILDs (+ I think a text file listing things in AUR) -> Cloud Build triggered -> builds packages, uploads to staging bucket, POSTs to a Cloud Function which then downloads them and signs them using an RSA key stored in Cloud KMS-or-whatever-it's-called and then uploads them to the real bucket + reindexes
<lukegb> it was neat but now I just, err, store my nixos config in a repo
<lukegb> and just build it with gitlab ci
<lukegb> much less exciting though
<red[evilred]> pie_ (IRC): if you need performant, safe, and the actor model - may I recommend pony?
aleph- has quit [Ping timeout: 260 seconds]
<red[evilred]> I use erlang/elixir for anything I need reliability for (because I'm lazy and adore OTP)
<red[evilred]> and I use pony for anything that needs actors and speed
<gchristensen> oh neat
<red[evilred]> how fast? The original runtime was designed for doing algorithmic trading
<gchristensen> I was writing some stuff in pony and got stuck on some caps and then had a child and haven't looked again ...
<red[evilred]> so it's very low latency and blisteringly fast
<__monty__> What does OTP stand for in this context?
<red[evilred]> as with all things gchristensen (IRC) - there's never a question of whether there's pain. It's just a question of whether it's at compile-time or run-time :-)
<red[evilred]> Open Telecom Project
<red[evilred]> sorry
<red[evilred]> platform
<red[evilred]> open telecom platform
<red[evilred]> to be clear- it has NOTHING to do with telecom - other than that was the domain that the erlang language was originally designed to solve
<red[evilred]> You can think of it as a way to structure your applications into actors
<red[evilred]> OTP provides a nice way to do things like syncronous and asynchronous messaging
<red[evilred]> hot code reloading (because your telco never calls you up to tell you that you can't call emergency services between the hours of 2-3am for "upgrades")
aleph- has joined #nixos-chat
<red[evilred]> and my favorite - because I'm lazy
<red[evilred]> The way that it handles errors is genius
<red[evilred]> To the point where - say you have an API call in your code to query some database
<red[evilred]> and that connection times-out
<red[evilred]> without you having to write a line of code to check for validity
KREYREEN has quit [Remote host closed the connection]
<red[evilred]> That API query process will die, and a "supervisor" will re-start it and cause the query to go again
<red[evilred]> so that whole "try this API call three times, and if it doesn't work fail" code we see everywhere else in the world - doesn't exist in erlang
<red[evilred]> because the language is structured to do all that kind of stuff for you automatically
<bbigras> how many times does it retry by default?
<gchristensen> zero by default, you create your own process supervision trees
da_dada has quit [Ping timeout: 240 seconds]
<bbigras> thanks
<red[evilred]> right - but the default supervision is 1 crash every 5 seconds iirc
<gchristensen> oh oops I guess there actually is one by default :D
<red[evilred]> Indeed there is
<gchristensen> it is really elegant. I never got to the point of actually implementing anything with it
<gchristensen> one time I wrote a nix remote build protocol decoder in it but ...
<red[evilred]> When you design your OTP application you break your application into things that will fail
<red[evilred]> and then build your supervision tree around that model
<red[evilred]> (or at least that's how I do it)
<andi-> but coming from sway it shouldn't fail
<gchristensen> they certainly don't want it to fail
<red[evilred]> I love your optimism andi- :-)
<red[evilred]> But the broader idea is that if your API fails more than once in 5 seconds
<andi-> just put everything in one unit. My code shouldn't fail and I really do not want it ot fail :D
<red[evilred]> then there's a problem with your state (ie, your call is invalid)
<red[evilred]> so it then kills the requesting process
<red[evilred]> which is then re-started by a different supervisor with a known good state
<andi-> I was thinking about erlang for build distribution for Nix.
<andi-> Would that even make sense?
<srk> I wrote highly inefficient sokoban solver that would spawn new process for each possible move and when one reached the solution it just terminated everything
<red[evilred]> The thing that I found joyful about it was that I wrote a production system in elixir (compiles to erlang) - using OTP
<gchristensen> andi-: 19:14 <gchristensen> one time I wrote a nix remote build protocol decoder in it but ...
<gchristensen> :P
<andi-> but ... time?
<gchristensen> erlang isn't known for being a fast data bus
<andi-> or but feasibility?
<gchristensen> messages involve a lot of copying iirc
<red[evilred]> it ingested 150,000 protobuff messages a second, did some regex / database lookups / reformatting, and syslog output
<gchristensen> yeah messages are good, messages are fast, but uploading like GB of build closure ....
<red[evilred]> gchristensen (IRC): In the language they do. In teh actual implementation - they don't
<andi-> gchristensen: pre-signed s3 urls and stuff?
<red[evilred]> the copying is a model - not reality
<gchristensen> could be great
<andi-> and just use erlang for the metadata?
<andi-> I was thinking about using AWS lambda but that looks so inflexible for running builds
<andi-> you can't even get an aarch64 runtime
<red[evilred]> But I spawned one process per message - so I was spawning 150,000 new processes a second. Each process processing a single message.
<red[evilred]> around 4% CPU usage, 40M RAM utilization
<red[evilred]> a single erlang thread is slow
<gchristensen> yeah, like, that is core competency for erlang
cole-h has joined #nixos-chat
<srk> nice
<red[evilred]> but it scales wonderfully
da_dada has joined #nixos-chat
<red[evilred]> the real magic is in the VM. It does really smart things.
<gchristensen> yea
<gchristensen> another gripe I have with erlang: the clustering authentication needs a refresh
<red[evilred]> like since the VM manages every process' mailbox - it knows that none of those processes with empty mailboxes will ever need CPU time
<red[evilred]> so it just ices them until a message is delivered
<andi-> oh yeah, I think I got as far was reading to docs for joining members to the cluster
<andi-> that all looked a bit weird for dynamic clusters
<gchristensen> did you get to the md5 part?
<andi-> I think so..
<gchristensen> frightful
<red[evilred]> But to give you an idea of how flexible
<andi-> was good enough for gdb until a few weeks ago ;)
* gchristensen is a big fan of erlang fwiw
<red[evilred]> In my application, maybe only 10% of the messages needed a database lookup
<gchristensen> andi-: gdb doesn't afaik run a networked service capable of arbitrary code execution ;_;
<red[evilred]> so when the database went down, any processes that needed database access would just crash
<andi-> gchristensen: little do you know
<red[evilred]> so those messages were silently discarded (as designed)
<srk> if just the syntax was a bit better :D
<red[evilred]> It's a thing of wonder to watch a production 1,000,000+ process erlang application crash log.
KREYREEN has joined #nixos-chat
<red[evilred]> pages of individual crashes - yet everything still works.
<gchristensen> srk: meh.
<red[evilred]> (I'm a real fan of OTP - I should probably shut up about it now) ;-)
<gchristensen> (that's a joke, using the atom "meh")
<red[evilred]> but if anyone has any questions - I'm happpy to be a resource
<srk> :)))
<gchristensen> red[evilred]: I got suckered in to erlang via rabbitmq 5-6yrs ago
<red[evilred]> ditto pony
<srk> red[evilred]: do you mostly write elixir or also pure erlang?
<red[evilred]> gchristensen (IRC): I'm so sorry :-)
<gchristensen> <3 rabbitmq
<red[evilred]> I mostly write elixir because I like the convenience of many of the libraries
<red[evilred]> but both languages are fully interoperable
<srk> yeah, the ecosystem looks nice
<red[evilred]> both at the compile and at the shell level
* lukegb accidentally diffs master...staging-20.09 and wonders why he gets GitHub unicorns
<red[evilred]> gchristensen (IRC): I love rabbitmq too -=- my only pain point with it is with other linux distros that package *ancient* erlang with it
<gchristensen> heh yeah
<red[evilred]> oh - I wonder what erlang NixOS packages with it
<andi-> with red[evilred] we finnaly have someone to look after the otp packaging?!?
<srk> red[evilred]: 22.3
<gchristensen> finally!
* gchristensen watches red turn pale
<srk> lol
<red[evilred]> in all seriousness - is there a need?
<gchristensen> always
<andi-> I remember two or three years ago it was all in a miserable state and I was trying to fix something tha trelied on it and I don't know anything about otp :D
<red[evilred]> I've been looking for the best place in the NixOS ecosystem to put my skills to best use
<andi-> rewrite systemd in erlang? :D
<andi-> so we can run our systems distributed
<red[evilred]> I assumed it would be security - but we have people for that. If erlang/otp/elixir is unloved - that's something I can certainly help with
<andi-> and do not care about ancient terms like servers..
<gchristensen> erlang-pid-1 when
<red[evilred]> as a pathalogical systemd hater - be careful what you wish for :-D
<andi-> great, feature parity in a week?
<red[evilred]> because I've looked at doing erlang pid-1 before :-P
<red[evilred]> Well, I can certainly get the crashing, instability, and bad documentation functionality of systemd implemented in a week
* red[evilred] nods
<red[evilred]> tee hee
<insep_> red[evilred]: yay there's someone in this room sharing my hate to systemd \o/
<andi-> contrary to sway systemd hasn't crashed on me yet in a verrrryy long time (where I didn't write a faulty patch)
<red[evilred]> dystmes htaers uniet! ## <-- "Systemd haters unite", on systemd :-)
<gchristensen> while true; do sway; done
<V> gchristensen: now you have to hope your shell isn't buggy
<red[evilred]> in all seriousness - that horse has left the barn
<gchristensen> no shell is as crashy as sway
<V> it's true ;_;
<red[evilred]> but because NixOS lets me ignore that systemd exists - I can pretend it doesn't
<gchristensen> even osh is more stable than sway
<V> but seriously in that case just write a little C program that just execs it in a loop
<samueldr> exec from PID 1 into sway
<samueldr> when it crashes, the kernel goes down too
<andi-> just optimise the reboot performance and remove all the state
<gchristensen> init=sway? I like it
<gchristensen> I mean, one thing that is good about sway is embracing the idea of "crash-only software"
<andi-> keep in mind that sway has to wrapped with the dbus session shi^Wstuff
<red[evilred]> Well, OTP's resiliance model is literally: "Crash early, Crash often, Kill all your children"
<red[evilred]> and it works
<gchristensen> that is my motto, man
<red[evilred]> the "Kill all your children" thing takes on a different meaning when you have your firstborn
<samueldr> just make sure sway somehow crashes into this https://en.wikipedia.org/wiki/Bomb_(icon)#/media/File:MacOs_Syserror.png
<insep_> red[evilred]: last time i tried nixos i did have disable systemd-resolved and start udhcpd on every boot
<andi-> ah, hobby-dnsd, nobody but lennart uses that
<insep_> considering that i had nixos installed in vm, that was quite often
<insep_> and i used that vm to work on pmos instead of mobile-nixos, i am that evil, hehe
<red[evilred]> My real issue with systemd is that it's spread out so much.
<red[evilred]> the init / replacing of rc.d I didn't really care about
<red[evilred]> but things like logging, and shells
<red[evilred]> shudder
<red[evilred]> "If your username begins with a number, you become root"
<red[evilred]> and "systemctl now has a function to spawn a shell like su, but with the environment set up like this instead"
<lukegb> I love executing javascript as part of the decision to allow restarting a service, wdym
<red[evilred]> (As best as I could tell from the text, Lennart didn't know the difference between "su" and "su -")
<gchristensen> lukegb: that is long older than systemd afaik...
<lukegb> yeah, it's policykit
<lukegb> or polkit now
<insep_> i hate the fact that polkit depends on mozjs
<red[evilred]> I'll confess - my knowledge of polkit is near zero
<insep_> and mozjs depends on rust
<lukegb> tbf, polkit's JS is better than policykit's XML-as-scripting-language
<red[evilred]> but sometimes I'll try to su and it just plain won't let me
<red[evilred]> I spawn anotehr shell and then su and it does
<red[evilred]> it's freaking weird.
<insep_> hm, someone needs to try to add quickjs support to polkit
<insep_> will make it more portable at least
<red[evilred]> But the day that I wanted to throw systemd into the fire was when it terminated all user processes on logout by default
<red[evilred]> completely destroying the functionality of screen and tmux
<gchristensen> love that
<red[evilred]> and then when people pointed this out - he said - paraphrasing: "Nobody has any business running processes when they're not logged in"
<gchristensen> agreed
<red[evilred]> It took 2 revisions iirc for there to be an opt-out flag in the config
matthewcroughan has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
<red[evilred]> since I'm on my soapbox :-)
<red[evilred]> I also hate that servers now have dbus
<red[evilred]> you know, the "desktop bus"
<srhb> I feel you :P
<red[evilred]> ./me shudders
<red[evilred]> whatever happened to things being simpler?
<lukegb> kdbus!
<red[evilred]> oh yeah
<lukegb> because unix sockets aren't good enough :P
<red[evilred]> let's put javascript messages in kernel space!
<gchristensen> things were never simple
<gchristensen> the complexity was always there, spread out across a hundred shell scripts, copy and pasted between distros with no place to file CVEs against
<red[evilred]> Well, I just didn't build complex machines :-)
<red[evilred]> on desktops - I get it
<red[evilred]> you have hundreds of thousands of use-cases
<das_j> red[evilred]: What about firefox | sudo tee /dev/kmsg
<red[evilred]> and environments that are going to change
<red[evilred]> but servers should be reasonably static
<gchristensen> we love to remember the username-begins-with-a-number-become-root issue, but also love to forget the "press enter a hundred times and you'll get root" from the bad old days.
<gchristensen> servers are not static, we've learned that lesson the hard way
<srhb> systemd does have a history of not investigating "why things are the way they are" before making sweeping changes. It's not always the case, but it's often the case. I like the philosophy if declarativeness, but wow, do they break stuff in fun ways.
<srhb> Looking at you networkd.
<red[evilred]> "why things are the way they are" <-- Exactly that.
<gchristensen> I think they often do investigate why they are, and decide to move past the bad old legacy that keeps us swimming in shit
<red[evilred]> it feels like reinvention for the sake of reinvention
<srhb> gchristensen: That's why I'm explicitly not referring to that
<cole-h> red[evilred]: Wait, I don't need to do that linger crap anymore?
<srhb> I'm A-OK with sweeping changes with good reasoning.
<red[evilred]> Okay - so can I ask a silly question
<red[evilred]> what's the reason for "seats" on a server
<red[evilred]> I genuionly don't know the answer
<red[evilred]> I'm also curious as to what dbus is actually used for on a server when things like network/ip are static
<red[evilred]> that's not be being argumentative - I genuinly don't know
<red[evilred]> I don't know what problem they were trying to solve with "seats" at all
<red[evilred]> (other than commercial licensing maybe?)
<bbigras> maybe it's simpler to have the same tools on desktop and servers. same tools to test and make robust.
<red[evilred]> bbigras (IRC): - That is certainly an argument that I can understand to a point.
<srhb> That's an annoying snipe. :-P
<gchristensen> I'm not sniped! I'm not sniped! *transforms in to a corn cob*
<srhb> :D
<srhb> Mostly I have flashbacks of some nix-build or the other scrolling past me and my brain going "why... on earth... does this machine use $foo" and deciding to save my sanity by ignoring it.
* gchristensen eyes /etc/pam.d/i3lock-color on his server
<srhb> These days I just blame everything on pinentry and move on with life. It's probably not true, but my brain likes stories.
* srhb doublethinks harder
<red[evilred]> one day I'll sit down and work out hhow to either: a. Disable systemd's logging. b. Get it to stop logging every single damn javascript failure. Every single window manager failed assertion etc...
<gchristensen> O.o
<red[evilred]> tailing my systemd log is just full scroll all the time. It's an insane amount of resource
<srhb> red[evilred]: Please fix journalctl shell completion while you're at it :P
<joepie91> siraben: TL;DR of Brave: business models so far have been a) replacing ads on people's sites without said site operators' consent and b) soliciting donations on behalf of people without said people's consent and now something something cryptocurrency, in both cases ignoring criticism and only backing down when it threatened to become a PR storm; they seem to have a real problem with understanding the concept of consent,
<joepie91> which makes them highly shady as far as I'm concerned
<red[evilred]> actually - on that subject
<joepie91> (no mental bandwidth for further discussion atm, just giving some pointers)
<red[evilred]> does anyone have any documentation on how to write and integration shell completion?
<red[evilred]> there are a couple of packages that don;t have it that I would love to contribute to
<srhb> I usually just use whatever library is available to autogen for my tool at hand, I've never hand-crafted...
<__monty__> joepie91: Thanks, knew I could count on you for what's up in browser land.
matthewcroughan has joined #nixos-chat
<red[evilred]> logs like this:
<siraben> joepie91: thanks. I've removed it from my system and replaced with ungoogled-chromium
<red[evilred]> ec 01 14:56:50 apophenia .cinnamon-wrapp[1637]: Object St.Icon (0xf495f0), has been already deallocated — impossible to set any property on it. This might be caused by the object having been destroyed from C code using something such as destroy(), dispose(), or remove() vfuncs.
<red[evilred]> Dec 01 14:57:46 apophenia rtkit-daemon[1604]: Supervising 9 threads of 7 processes of 1 users.
<red[evilred]> Dec 01 14:57:46 apophenia rtkit-daemon[1604]: Successfully made thread 44560 of process 44501 owned by '1000' RT at priority 10.
<__monty__> siraben: I seem to recall some issues with that too >.<
<__monty__> Not the same level of shady though.
<red[evilred]> I genuinely don't understand why rtkit is reporting processes when I move around in my browser
<samueldr> IIRC ungoogled chromium is based on trust on the changes that are hard to grasp... and hope that they got all the google bits out
<eyJhb> siraben: I want a review of ungoogle chromium :p
<samueldr> though at least you can totally inspect its source
<joepie91> __monty__: oh no, have I become the browser person? :P
<samueldr> joepie91: become?
<red[evilred]> btw - I know that I'm treading on dangerous ground asking this in chat - but do we have a WSL (Windows Subsystem for Linux) image of NixOS (or nix for that matter)?
* eyJhb kicks red[evilred]
<samueldr> red[evilred]: sounds like it's your user session's stuff, most likely the session is setup to log its own output to the journal or the display manager is, or something along the line
<samueldr> no image yet AFAIK
<samueldr> not dangerous since WSL
<samueldr> dangerous since NixOS
<samueldr> :)
<joepie91> lol
<red[evilred]> I wonder what would be involved in making that happen
<red[evilred]> I should research that
<srk> there were prior attempts iirc
<samueldr> yes
<samueldr> g//huntley IIRC was involved
<red[evilred]> btw - in all seriousness - if someone can point me at examples / conversations / issues with the erlang/elixir/otp environments that need work I'm happy to look at / maintain them
<red[evilred]> OH HAI! a label for topic:erlang
<red[evilred]> I should take a peek
<siraben> eyJhb: re review of ungoogled-chromium: sure, I don't use it much beyond websites that don't work well on firefox and for running it in --app mode
<eyJhb> Ahh, you use it reverse of me then :D But fair
<eyJhb> I use Firefox for... Okay, you got me. Office 365, since they suck at having multiple organisations I guess
<eyJhb> Seems like I should try ungoogled
<red[evilred]> ah, found a mammoth rfc thread
<red[evilred]> found mah peeps
<V> <red[evilred]> tailing my systemd log is just full scroll all the time. It's an insane amount of resource ← o.O
<red[evilred]> so, is the implication that it's just me? :-P
<V> I definitely get firefox javascript error spam, but that's fine by me. I can filter it
<red[evilred]> filter it how?
<V> and like. i want that
<srhb> Definitely beats, like, ~/.xsession-errors or whatever we used to have :P
<V> grep -v 'JavaScript error' :p
<red[evilred]> hah
<V> but more seriously, if you can have a systemd user service per-application, you'd be able to filter out firefox like that entirely
<joepie91> javascript errors are the bane of my existence
<joepie91> interpret that as you wish :P
<V> I haven't gotten around to doing that yet
<samueldr> joepie91: *searches for batman bane quotes*
<joepie91> no laughs for my double pun? ::
<red[evilred]> V (IRC): at some point I need to read the systemd docs
<joepie91> :P*
<red[evilred]> I only got one of teh puns, sorry
<V> okay, so looking at the last 30 lines: thye're all JavaScript errors, "event14 - SynPS/2 Synaptics TouchPad: kernel bug: Touch jump detected and discarded" (and another couple of synaptics touchpad erorrs), JSON of `[{"success": true}]` except spread across 5 lines... that's literally it
<V> 30 lines over a period of 20 minutes, so I would say the rate of messages you're getting is insane
<joepie91> red[evilred]: "interpret"! though JS isn't typically interpreted, people usually still assume that it is, so I'd hoped at least someone would get it :P
<V> (also, this is just journalctl --user, not full system logs)
<V> 30 lines of full system logs take 5 minutes
<red[evilred]> yeah - interpret was was a caught
<V> are mostly my CPUs being too hot and getting throttled
<V> and dhcpcd and geoclue
<red[evilred]> I do not regret replacing my 8 year old dual Xeon workstation with this stupid baby Ryzen 7 machine
<red[evilred]> completely silent, twice as fast
<V> red[evilred]: systemd manpages are okayish
<V> very dense though, not the most approachable of content
<red[evilred]> the only real disadvantage was the 32G RAM limit
<red[evilred]> and the lack of an additional pcie slot
<red[evilred]> thanks - I'll take a peek
<red[evilred]> maybe I should dedicate a few hours to getting over my irrational hatred of systemd and fully read the docs
<gchristensen> probably
drakonis has quit [Quit: ZNC 1.8.2 - https://znc.in]
<red[evilred]> then I'll either become a convert or a rational hater
<red[evilred]> both I guess is an improvement
<gchristensen> it is really good and adds a lot of control points and auditing that I think someone of your ilk would appreciate
<V> red[evilred]: I used to be an irrational hater. I'm now a happy user, with the understanding that some of it is shit
<red[evilred]> I did see a "systemd-audit security" (?) output in an issue I was following about systemd sandboxing
<red[evilred]> and that got me curioed
<V> systemd-analyse security
<red[evilred]> thx
<V> it's nice. they have knobs for p. much everything you can think of for sandboxing a service
<red[evilred]> I reallly like capability-based approaches
<V> it's not what I would design if I were building a service manager
<V> since it's all blacklist and not whitelist, but it's definitely an improvement over the state of the art
<V> and same, I'm an objcap nerd
<red[evilred]> pony uses it for its library support which is awesome. You don't need to worry so much about a malicious library if you don't grant it the capabilities it doesn't need
<gchristensen> objcap nerds, assemble, in your own little pods unable to touch eachother!
<red[evilred]> haha
<V> :)
<joepie91> gchristensen: that does seem to fit into the general theme this year
<red[evilred]> speaking of, I was idling wondering after reading the threads on committers and establishing trust on discord about whether if nix had the concept of capabilities that could help
<gchristensen> finally!
<joepie91> :P
<gchristensen> nix is an object-capability safe language
<pie_> its so nice when people are receptive
<red[evilred]> if a committer could only commit inside a certain say, "namespace" (to be defined) - then we could know the scope of worst-case for a malicious commit
<V> it's *kind of* an object-capability safe language
<pie_> started walking my guy through nix-shell and nix repl
<V> it can definitely be subverted
<gchristensen> V: hush
<pie_> probably not the most didactically sound curriculum but yea
<V> gchristensen: =w=
<gchristensen> (I say, winking)
<red[evilred]> If it's in the docs it must be true
<V> what docs?
<V> (I say, winking)
<red[evilred]> Microsoft: "Office365 will not allow anyone access to any of your users mailboxes without 2-factor"
<red[evilred]> Me: "Connects to Office365 via some convoluted MAPI over HTTP encapsulation end-point with no 2-factor auth"
<red[evilred]> OldBoss: "Why did you test that? They said it wouldn't work"
<joepie91> maybe they meant "everyone" instead of "anyone"
<red[evilred]> Me: "... but yet it did"
<energizer> i need something like a makefile to set up a few commands in my project. do i want to use nix for this job, or something else?
<energizer> eg to convert my markup to documentation in various formats
<red[evilred]> Pretty much every project I have I have a shell.nix and a Makefile
<red[evilred]> then when I come back to it, I can look at the Makefile to remind me of all the things
<energizer> so you're using make. i could do that, but i'm noticing https://www.boronine.com/2018/02/02/Nix/ which makes the point that nix could do make's job
<V> energizer: a makefile is a decent way to specify stuff like that. nix isn't so well tooled for that (do you have multiple tasks?)
<energizer> V: i will have multiple tasks
<V> Nix doesn't have good support for specifying build rules currently so pretty much everything you do of that sort can be expressed more concisely with a Makefile
<V> (I say, while using it for literal HTML templating)
<V> energizer: also, if you are going to use Nix, don't do what that post suggests. use runCommand and friends from trivial-builders.nix
<joepie91> you can just use `nix build` with a specific attribute, no?
<V> joepie91: sure, but `make <target>` is always going to be shorter
<V> a Makefile for tasks like that is literally just the names of the tasks + the commands used in them. you can't get simpler than that
<V> use the right tool for the job, etc
<energizer> nix will handle obsoleting things more accurately than make, right?
<V> I'm not sure what you're asking?
<joepie91> V: ah, I have the solution! it's obvious! just use a Makefile that invokes `nix build` commands! 🤡
<V> joepie91: lol
<energizer> how does make know if it needs to rebuild the dependencies of a command?
<LinuxHackerman> `alias b='nix build -f .'
<LinuxHackerman> * `alias b='nix build -f .'`
<V> joepie91: no, you can do better than that. just `alias make="nix build"`
<V> energizer: oh. yeah, nix does better than make here
<energizer> V: so if i use LinuxHackerman's alias nix will be better than make in every way?
<V> in terms of reproducibility/etc? yes. in terms of ease of writing rules? no
<philipp[m]> Does anybody know a nice and small ouauth provider that supports 2FA that I could self host without much pain?
<philipp[m]> (I know about keycloak...)
<bbigras> I'm planning to use keycloak at work but don't we also have oauth-proxy or something like that
<philipp[m]> I am running keycloak at work and it's nothing I'd like to self host for myself.
<philipp[m]> It really assumes to run in i proper cluster with redundant databases and all that. Very Enterprise.
<samueldr> wow, google pixel (1) on ebay are so overpriced, comparatively to same vintage other OEM phones
<samueldr> often "good condition", but actually all banged up and the screen is burned in
<bbigras> philipp: check services.oauth2_proxy
<bbigras> hmm. maybe that software is more like to put in front of a web server.
<bbigras> a bit like I'm using openresty (the nginx + tools thing) to allow/deny access with an oauth provider
<__monty__> Checking out the bitwarden-cli, wow, what a pain to create a password entry.
<bbigras> it's weird how we fetch password too, by the id
<hexa-> brrr … home-manager sway reloads repeatedly break one or another aspect of the running sway instance.
<hexa-> this time input
neeasade has joined #nixos-chat
<philipp[m]> bbigras: Yeah, I'm looking for a counterpart to deploy exactly this software with.
lassulus has joined #nixos-chat
<philipp[m]> It seems like gitea has that capability.
<bbigras> nice
<__monty__> I'm literally finding it impossible to add a password via the bitwarden-cli because it contains a space and my (non-existent) jq-fu isn't up to scratch (even with SO).
<samueldr> see
<samueldr> this is why passwords should be lowercase letters only
<samueldr> and short
andi- has quit [Ping timeout: 244 seconds]
<__monty__> Because of one obtuse CLI that has you manually crafting JSON objects rather than going through a couple prompts?
<samueldr> yes
<__monty__> Well, I can't fault that logic now, can I?
<energizer> you might want -r or -R
<philipp[m]> You want to be carefull with logic and recursion. Can make your head hurt.
andi- has joined #nixos-chat
<__monty__> energizer: Maybe I do, it works but now I have no idea why. Being unfamiliar with jq and the escaping nightmare that is nesting subshells is not a great combo.
<energizer> which one was it?
drakonis has joined #nixos-chat
<philipp[m]> Yes, please paste the entire password here and then tell us exactly what chars you had problems with.
<bbigras> we wont see it because https means it's secure
Jackneill has quit [Ping timeout: 272 seconds]
thibm has quit [Quit: WeeChat 2.6]
liff has quit [Ping timeout: 244 seconds]
Jackneill has joined #nixos-chat
<bbigras> haha yeah, like the Bill Gates one that was posted earlier.
lassulus_ has joined #nixos-chat
lassulus has quit [Ping timeout: 260 seconds]
lassulus_ is now known as lassulus
mystfox has quit [Quit: Restarting for updates...]
glowpelt has joined #nixos-chat
<infinisil> ,aoc
<{^_^}> Join us in the Advent of Code. We need your help, Santa's in trouble! #nixos leaderboard: 397598-41437759 https://adventofcode.com
<infinisil> Just solved it in Nix as well :)
<ekleog> anyone has easy access to a non-nixos laptop here? wondering whether something I'm seeing with gcc is the result of nixos automagically adding some hardening flags or similar
liff has joined #nixos-chat
<ekleog> (I'm looking for someone available to run `echo "int main() {}" > foo.c && gcc foo.c && readelf -l a.out` on non-nixos and paste me the result; nixos looks like it enables full relro even without any flag specified)
<samueldr> ekleog: https://godbolt.org/
<samueldr> not sure if it can help you
<ekleog> oh I had never seen it had a readelf tool! looks like picking “compile to binary” and the readelf tool helps, thank you <3
<samueldr> I didn't know it had a readelf tool, I didn't actually try it lol
<samueldr> I simply knew it was *the* tool to look at compilers
<ekleog> heh well, so you've learned something today too I guess :p
<energizer> a laptop with a sub-4k screen can still output 4k on an external monitor, right?
<sphalerite> energizer: maybe.
<sphalerite> energizer: depends on the graphics chip. But not having a 4k built-in monitor does not prevent it from outputting 4k to an external monitor, indeed.
__monty__ has quit [Quit: leaving]
<energizer> ok
<sphalerite> energizer: you can check it for intel processors on ark, https://ark.intel.com/content/www/us/en/ark/products/97462/intel-core-i7-7920hq-processor-8m-cache-up-to-4-10-ghz.html for example shows the max resolution achievable via various interfaces
<sphalerite> I think pretty much all modern discrete graphics cards should support 4k
cirno-999 has quit [Ping timeout: 240 seconds]
cirno-999 has joined #nixos-chat
* samueldr hopes he's done writing-up write-ups for a while
neeasade has quit []