gchristensen changed the topic of #nixos-chat to: NixOS but much less topical || https://logs.nix.samueldr.com/nixos-chat
<gchristensen> a program which watches strace and auto-tcontructs buildFHSUSerENv for you
<samueldr> an rpi can go from just fine to headaches in that situation
<samueldr> you probably don't want to store to the sd card, so external hard drive(s)
<samueldr> powering them can be an issue
<Ralith> manveru: how much space? how much fault tolerance? what access patterns? etc
<gchristensen> yarr I can't manage to get oxygen to display its main window
<gchristensen> well ... it displays, and thinks it has displayed, but the actual window is empty... but I can hover over stuff and the mouse changes
<gchristensen> maybe time for a VM
<thefloweringash> I had a very similar experience with IntelliJ under sway. Completely blank window, but if I clicked in the top-leftish the menus worked.
<gchristensen> iiinteresting
<gchristensen> I wonder if there is a way to encourage it gently to use X ...diferently?
<gchristensen> " The version of Java bundled with Oxygen requires X.org. Wayland is unsupported." ah!
<thefloweringash> I found a workaround for intellij: https://github.com/swaywm/sway/issues/595, the _JAVA_AWT_WM_NONREPARENTING=1 setting is sufficient
<{^_^}> swaywm/sway#595 (by jarias, 3 years ago, closed): IntelliJ Idea show weird blank screen
<gchristensen> oh
<gchristensen> my gosh
<gchristensen> thefloweringash: thank you!!
<thefloweringash> did that work for oxygen too?
<gchristensen> yeah!
<thefloweringash> yay! :)
<gchristensen> oh yay I don't even need to use the FHS anymore, either
<drakonis1> :o
<drakonis1> is there a program for watching strace to automatically build the fhs environment?
<gchristensen> I wish
<gchristensen> https://gist.github.com/grahamc/1cfa8090e252325b35d07b068c238a75 + `strace -f` gets close though
<gchristensen> holy crap oxygen is amazing
<ashkitten> ugh, rebuilding qt for i686 because of #63829
<{^_^}> https://github.com/NixOS/nixpkgs/issues/63829 (by tadeokondrak, 1 week ago, open): pkgsi686Linux.qt5.qtbase fails to build
<ashkitten> takes so long
<gchristensen> it can go from emitted HTML back to the XSLT which created it
<samueldr> gchristensen: so you can cheat by applying something by hand and making it write xslt?
Drakonis has quit [Ping timeout: 252 seconds]
<gchristensen> unfortunately, no
<gchristensen> but I can click on the ToC thing and say okay what made that
Drakonis has joined #nixos-chat
cjpbirkbeck has joined #nixos-chat
drakonis1 has quit [Quit: WeeChat 2.4]
drakonis_ has joined #nixos-chat
Drakonis has quit [Ping timeout: 258 seconds]
Myhlamaeus1 has quit [Remote host closed the connection]
Miyu-chan has joined #nixos-chat
<Miyu-chan> Hm.
<clever> Miyu-chan: what i really want to do, is add support for this mips-like language: https://gist.github.com/cleverca22/465314761110b26e65383289f2dc10f5
<Miyu-chan> Is Writer a Free Monad tho?
<Miyu-chan> Uh, Writer is basically Monoid a => (a, x) IIRC
<clever> type Writer w = WriterT w Identity
<clever> ah, its a writer transformer, over the identity monad
<Miyu-chan> (Also, I no longer surprisingly use Haskell.)
<Miyu-chan> Hm, wait.
<clever> newtype Identity a
<Miyu-chan> I no longer use Haskell, surprisingly.
<Miyu-chan> Yeah.
<clever> this is a special monad, that basically can only return an item and nothing else, i think
<clever> but you can then layer monad transformers ontop of it
<Miyu-chan> (I was considering coming back tho, I actually just read about comonads OTW home 2 days ago.)
<Miyu-chan> And yeah. Writer also requires a monoid.
<Miyu-chan> Hm.
<Miyu-chan> This is kinda interesting.
<Miyu-chan> I wonder if there's a cat theory explanation about Writer.
<Miyu-chan> Like, you know how Monad is just a Monoid in the ... or whatever that joke is.
<clever> Miyu-chan: there is a game on steam called stationeers, and it has a script language within it, based on mips
<clever> it looks like assembly, but its not really
<clever> all registers are floats
<clever> all registers and stack are nvram, and persist thru power loss
<clever> code will resume running at the same addr and state, even if you rip the chip out of the socket, and plug it in a week later
<clever> no ram, only registers
<clever> 128 lines of code max
<clever> comments and blank lines count towards it
<clever> relative jumps are line based, and count comments/blanks
<clever> labels save you from counting, but also count towards lines
<clever> and i think it can run up to 128 lines of code per half second
<clever> with a yield opcode to stall till the next tick
<Miyu-chan> Have you checked out Shenzhen I/O and TIS-100?
<clever> Miyu-chan: the goal, is to write haskell, and compile down to that :P
<Miyu-chan> Also, lmao
<clever> heard of them, but not looked into them
<Miyu-chan> Let me give that a check.
<Miyu-chan> Is Stationeers the space game?
<clever> https://stationeering.com/tools/ic is a simulator for the IC
<clever> yeah
<Miyu-chan> I've considered playing that
<clever> space engineers is an older (windows only) game, that has similar stuff, but stationeers is more focused on realism and difficulty
<Miyu-chan> Oh wait.
<clever> in SE, a ship is made up of blocks, and power magically flows between any producer and consumer
<Miyu-chan> Okay. Mixed things up. I've considered playing Space Engineers.
<Miyu-chan> Not Stationeers.
<clever> in stationeers, power must run thru wires, which you have to run from a->b
<clever> normal wires have a 5kW rating, and will burn up if you overload them
<clever> heavy wires have a 100kW rating
<ashkitten> upsides to using nix: automatically rebuilding things if the package isn’t in the binary cache
<ashkitten> downsides to using nix: applying a patch to fix a bug and accidentally rebuilding gcc, qt5, and everything that depends on them
<clever> when wires do burn up, it will create a spark, which can ignite gasses in the atmo
<clever> in SE, a perfectly sealed ship can be pressurized, and it will just magically be a breathable atmo, made from ice
<clever> ice turns into EITHER H2 or O2, but never both!!!
<clever> if you breach the hull, the entire atmo is lost instantly
<clever> in stationeers, a ship doesnt have to be sealed perfectly, and air will diffuse and leak out holes over time
<clever> every cube of space also has its own mix of gasses, and temp
<clever> and you need the right partial pressure of O2 to be able to breath without a suit
<clever> lower pressures require a higher percentage of O2, so its effectively the same amount of O2 in a given volume
<clever> ice can be split into a perfect 2:1 ratio of H2 and O2
<Miyu-chan> Oh
<clever> and if such a mixture goes over 30c, it will catch fire, and the ideal gas law works, so the pressure/volume will rapidly rise
<clever> a mod i recently tried, sets the atmo of the entire planet to a 2:1 mix of H2:O2
<clever> 1 spark will set the entire planet on fire :P
<clever> you need a welding torch to build walls....
<Miyu-chan> lmao
<Miyu-chan> Also, yeah.
<clever> i played on that map for a few days, but now i have a fire in the basement, and just loading the map causes the planet to catch fire
<Miyu-chan> I've read about partial pressures a few times, and the toxicity is actually independent of the amount but instead of the partial pressure ,right?
<Miyu-chan> Toxicity of oxygen, I mean.
<clever> that sounds right
<clever> in SE, you generate O2 from ice, which occurs in massive lakes, or an O2 generator, which is a sealed box that turns sun+power into O2
<clever> in stationeers, you can find oxites (O2+N2 ice) as an ore rarely, or grow plants, which need the right temp, sunlight, CO2, a lack of toxins, and deal with the waste heat the plants generate
<clever> left un-attended, plants can pump out enough heat to cook themselves and kill the entire field
<Miyu-chan> "a lack of toxins" how about the ones generated by chloroplasts?
<Miyu-chan> Wait
<clever> plants dont generate any toxins, yet
<clever> but fire and smelting does generate toxins
<Miyu-chan> Chloroplasts generate toxins, right?
<Miyu-chan> Or did I just prove once again that I'm so crap at biology lmao
<clever> ive not heard of that
<Miyu-chan> Wait, crap.
<Miyu-chan> Wait, why don't animals have chloroplasts again
<clever> in stationeers, plants turn CO2 into O2, generate heat and consume water
<clever> if the plant is too cold or too hot, it takes damage
<clever> if X is present in the air, it takes damage
<clever> and it needs sunlight (or a grow lamp) to grow
<clever> when it hits full growth, you can harvest 2 or 3 of the plant, so it can multiply
<Miyu-chan> Ohh
<Miyu-chan> I'm giving Stationeers a look right now. In case that I get the free time(read: time not playing Shadowverse) to play it.
<clever> in space engineers, the "oxygen generator" is basically a box with plants, that you just point at the sun, give it power, and it generates O2
<clever> but it has none of the fun mechanics that stationeers has :P
<clever> stationeers also works great under proton on nixos
<Miyu-chan> TBF, I'm kinda convinced that you can game on practically any non-AAA games under Linux now.
<clever> space engineers is .net based, which still has some problems under wine
<Miyu-chan> I haven't had any game that didn't work under Proton. OTOH, sample size of 4, soo...
<clever> borderlands2 and elite dangerous dont even start right
<clever> megaton rainfall has major graphical problems, and is nearly imposible to control (or even exit)
<clever> basically every other game ive tried works nearly perfectly
ajirx has quit [Remote host closed the connection]
ajirx has joined #nixos-chat
Jackneill has joined #nixos-chat
<pie_> plants in a box is probably like the worst 02 generator ever
<pie_> i mean O2 but 02 works too
<pie_> but i wouldnt know
<eyJhb> pie_ you just gave me slight PTSD that I was to a exam and got a 02 (barely passed)
ajirx has quit [Remote host closed the connection]
ajirx has joined #nixos-chat
cjpbirkbeck has quit [Quit: Quitting now.]
<ivan> TIL I had two gigabit Intel NICs that upload ~560mbit max because Linux's workaround was to slow things down instead of turn gso/tso off (enabling gigabit) https://wiki.hetzner.de/index.php/Low_performance_with_Intel_i218/i219_NIC/en
<clever> ivan: the gigabit cards in my router randomly fail to tx, causing the card to stall for ~15-30 seconds until the kernel does a hard-reset
<ivan> have you tried turning off IPv6!
<ivan> that fixes my AT&T router :(
<clever> ivan: i dont see how v6 would impact it, and the wan interface isnt using it
<clever> sources ive read say its to do with 64bit dma
drakonis_ has quit [Ping timeout: 258 seconds]
drakonis_ has joined #nixos-chat
<joepie91[w]> when did github add this?
<manveru> that's been there for a good while
<manveru> ok, i was thinking of security alerts
<manveru> advisories are from this year
__monty__ has joined #nixos-chat
__monty__ has quit [Read error: Connection reset by peer]
__monty__ has joined #nixos-chat
<eyJhb> __monty__: will you ever get a bouncer? :D
<eyJhb> ,locate bin jq
<{^_^}> Found in packages: jq.bin
pie_ has quit [Ping timeout: 246 seconds]
veske has joined #nixos-chat
veske has quit [Quit: This computer has gone to sleep]
<eyJhb> Is it bad to use `jq` in a script that you might distribute ? Like it seems like the best way to make a simple script that checks version numbers
<gchristensen> why would it be bad?
<eyJhb> Just thinking about... How many actually have jq, or if it is widely available on all distros
<gchristensen> ah
<gchristensen> #!/usr/bin/env nix-shell :)
<eyJhb> Well, that would be very nix :p But not very mac, ubuntu, debian, fedora, etc. like :D
<gchristensen> they can install Nix, too
<etu> :D
<eyJhb> Haha, spreading Nix one by one ;)
<gchristensen> easier than giving "for mac, do X to install jq." "for ubuntu, do X to install jq."
<eyJhb> Well yeah, but... It might be quicker for them to install jq ;)
<eyJhb> But my script works now! But.. I have no clue on 1 to 10 how ugly it is
<manveru> wanna share? :)
Jackneill has quit [Ping timeout: 268 seconds]
<eyJhb> manveru: https://termbin.com/e5sw
<eyJhb> Open for suggestions, but it is really just meant as a single script that could function as a "update hook"
<manveru> pretty sure there's a releases api...
<manveru> that would give you want you want
<eyJhb> That.. is the releases API?
<manveru> `GET /repos/:owner/:repo/releases/latest`
<manveru> that one
<eyJhb> manveru: you sure that works for projects?
<manveru> yeah, just meant for the sorting and stuff...
<manveru> hm
<manveru> oh damn
<manveru> i was thinking github, ignore me :D
<eyJhb> Ah... That would make it.. Quite some harder :p
<eyJhb> And I would have hated myself, because I was trying to find that call ! :(
<manveru> well, looks perfect then :)
<manveru> yeah
<manveru> sorry, haven't done much with gitlab
veske has joined #nixos-chat
<eyJhb> Oh yeah, completely forgot .... Thanks :D
waleee-cl has joined #nixos-chat
<eyJhb> ... Forgot again
Jackneill has joined #nixos-chat
<eyJhb> Thanks manveru ;)
<__monty__> eyJhb: Nevaaaaaar!
<eyJhb> manveru++
<{^_^}> manveru's karma got increased to 16
<eyJhb> Go go __monty__ :D
<manveru> heh
<eyJhb> It is almost like we can track your sleep cycle!
<__monty__> Not quite. But you can definitely monitor when I'm on the computer.
Jackneill has quit [Ping timeout: 245 seconds]
Jackneill has joined #nixos-chat
Drakonis has joined #nixos-chat
<andi-> yay my DO spaces space is almost empty.. Now it just has 3 files that can't be accessed, deleted or modified.. :/
drakonis1 has joined #nixos-chat
drakonis_ has quit [Ping timeout: 258 seconds]
<gchristensen> lol...
Drakonis has quit [Ping timeout: 276 seconds]
<eyJhb> andi-: how long has it currently taken?
Drakonis has joined #nixos-chat
<andi-> eyJhb: since monday
<andi-> (my API credentials are still valid after deleting it on the UI)
<eyJhb> Yeah.. DOs API isn't that great
<eyJhb> Rather unstable too
drakonis1 has quit [Ping timeout: 250 seconds]
<eyJhb> Anybody know the minimal size of a NixOS Install? E.g. just having like, and the default rebuild available etc.
<joepie91[w]> eyJhb: I suspect that if anybody can answer that question, it's probably clever
<eyJhb> Is clever the size guy?
<joepie91[w]> clever is the not-os guy(?) :P
<joepie91[w]> so I expect them to know what the various overheads are
<eyJhb> Hmm fair enough, hoping he will see these pings then :p Considering nixos more and more. But I would still need to create a template for DO...
<eyJhb> I wonder if cloud-init works well on NixOS
<samueldr> except that not-os is not nixos :)
<joepie91[w]> samueldr: yes, that is my point :P
<joepie91[w]> the process of getting to a small stripped-down variant of a Thing, generally involves learning about the overhead and constraints of the Thing
<joepie91[w]> :)
<eyJhb> Am I completely lost, or how can I get packer to give me a vmdk, vdi, or anything DO supports? I only get ova or ovf...
Drakonis has quit [Ping timeout: 276 seconds]
Drakonis has joined #nixos-chat
<joepie91[w]> eyJhb: it doesn't support ova...?
<joepie91[w]> that's weird.
<joepie91[w]> they support a bunch of formats, but not the standardized format...?
<eyJhb> Or more like `gz, bz2, vmdk, vhdx, qcow, qcow2, vdi, raw, img, xz`
<joepie91[w]> maybe ask support
<joepie91[w]> this is a weird omission
<eyJhb> The best part. Packer actually CREATES the vdi, but it then export it to ova, and deletes the vm
<eyJhb> Ohh, I have tried DO support regarding this.. Noted that the example they give specifies .iso, and .iso is not allowed... Got a standard reply "We currently do not support .iso"....
<eyJhb> `The URL you have entered is not a valid URL. Make sure it includes the protocol and the file name, e.g. http://example.com/file.iso`, *slow clap*
drakonis_ has joined #nixos-chat
<gchristensen> apparently SwiftOnSecurity is a man?
<__monty__> While you thought AI?
<gchristensen> ah yes, the two genders. man and AI
<PyroLagus> it's true
Drakonis has quit [Ping timeout: 250 seconds]
<PyroLagus> kizuna ai may look and sound like a girl, but canonically she's genderless
<joepie91[w]> PyroLagus: when did you get here!
<joepie91[w]> :P
<PyroLagus> when i found out that #nixos-chat is a thing
<joepie91[w]> PyroLagus: I had to double-check that I wasn't in #rust-offtopic...
<PyroLagus> lol
<joepie91[w]> PyroLagus: anyway, I didn't realize you were a NixOS user (or my memory has just failed me again)
Drakonis has joined #nixos-chat
<PyroLagus> i use arch btw
<PyroLagus> but i do use nix
veske has quit [Quit: This computer has gone to sleep]
<PyroLagus> i have used nixos as my main system in the past, but i was dissatisfied with the update reliability
<joepie91[w]> oh
<joepie91[w]> right
<joepie91[w]> in what sense?
<PyroLagus> sometimes there were weeks without updates, including security updates
<joepie91[w]> ah, right.
<joepie91[w]> hopefully the Nix flakes thing will reduce that
<PyroLagus> it seemed to have improved since then, but there's still no way to push through security updates
<PyroLagus> Nix flakes?
<joepie91[w]> though even then, I feel like there should be some sort of two-layer update system
<joepie91[w]> right
drakonis_ has quit [Ping timeout: 245 seconds]
<joepie91[w]> tbh there should probably be a 'channel forking' mechanism of some sort, where there's a separate security-update channel that security updates get applied to, and that gets rebased on every successful regular-channel build, and the eventual 'published channel' would be either the output of the security-channel or the regular-channel depending on which got built last
<joepie91[w]> well, rebased is maybe not the right word
<joepie91[w]> rather that the security update channel should flip over to a new regular-channel build once there is one, and it should apply future security patches to that
<joepie91[w]> that'd still require holding back successful channel builds on the regular-channel, though, if in the meantime a security patch has been applied
<joepie91[w]> until the regular channel has been rebuilt with the patch also
<joepie91[w]> now that I'm reasoning through it, I realize that this could probably be implemented entirely build-side, and wouldn't require any changes to Nix itself
<PyroLagus> huh, so i guess you could have a nixpkgs flake and a security updates flake?
<joepie91[w]> PyroLagus: well, not exactly like that, you'd still be explicitly installing a thing from a specific source. though I guess it'd be easier to manually switch over to a patched build from an external channel/flake (that's based against nixpkgs), but that's still manual work
<joepie91[w]> I expect flakes to be useful more in the sense that particularly difficult-to-build things can be moved out to separate 'repositories' that don't get in the way of regular channel evaluations
<joepie91[w]> so that the lag on the main channel is reduced
<PyroLagus> ahh
<PyroLagus> that would be nice
<joepie91[w]> PyroLagus: right. that is a solution, but - if this is the approach I'm thinking of - it *does* violate certain guarantees
<joepie91[w]> (that may be an acceptable tradeoff, mind, but it's something to keep in mind)
<joepie91[w]> essentially you'd have to verify yourself that the replacement is fully API-compatible with the thing it replaces
<joepie91[w]> otherwise you could end up introducing a breakage that does not exist in a clean (pre-graft) build
<joepie91[w]> and so your build is not reproducible anymore
<PyroLagus> yeah
<joepie91[w]> the benefit of a channel forking mechanism would be that it doesn't need to break those guarantees in most cases; it would only warrant mass rebuilds when commonly used libraries are affected
<joepie91[w]> ultimately I suspect that much of the channel lag for NixOS is not due to rebuilds triggered by a security update, but rather by already-succeeded builds having to wait on a bunch of other unrelated builds that happen to be in the same package set but are not required for deploying the security update
<joepie91[w]> and that's the lag you could cut out entirely with a forking approach
<PyroLagus> i think so too
<joepie91[w]> would probably still be helpful to have a grafting-like mechanism for the remaining cases, where there's a vuln in libc or curses or openssl or whatever
<joepie91[w]> but, easy wins are easy wins :D
<joepie91[w]> </ramble>
<PyroLagus> like, i don't care about getting supertuxkart at the same time as that fix for a firefox 0day
<joepie91[w]> right :P
<PyroLagus> well, you have to wait for supertuxkart to build even if you don't use it
<__monty__> Which is actually kinda strange. Since a nixpkgs with two derivations depending on different versions of another derivation wouldn't be hard to manage.
<PyroLagus> it also kinda sucks that failing tests for things you don't use can delay updates for you, but i don't know how that could be fixed
<joepie91[w]> PyroLagus: that would be addressed also by the channel forking approach, assuming the test failures are deterministic
<PyroLagus> ah
<joepie91[w]> since the diff of a security channel update would be tiny compared to the last known-good build
<joepie91[w]> so the chances of that security update breaking a test are really rather small
<joepie91[w]> (most test failures are probably because of unrelated software version upgrades, though I don't have hard data on this)
<joepie91[w]> I should maybe make an RFC out of this some day
<PyroLagus> :)
<elvishjerricco> So nice to be able to come back to a project after almost a year and still have it totally reproducible.
jackdk has quit [Quit: Connection closed for inactivity]
Drakonis has quit [Ping timeout: 276 seconds]
Drakonis has joined #nixos-chat
Miyu-chan has quit [Read error: Connection reset by peer]
drakonis_ has joined #nixos-chat
Drakonis has quit [Ping timeout: 244 seconds]
drakonis_ has quit [Ping timeout: 252 seconds]
Myhlamaeus1 has joined #nixos-chat
waleee-cl has quit [Quit: Connection closed for inactivity]
pie_ has joined #nixos-chat
<elvishjerricco> Finally figured out a way to make that log2rotate thing a lot more tunable. This shows how many backups you’d have from each two month period over two years using it, if you took one backup a day. You can effect the shape of the curve by using a different log base or a different multiplier. https://usercontent.irccloud-cdn.com/file/neVElMpZ/histogram.svg
<elvishjerricco> And this is what it’d look like if you did one every ten minutes for two years, using the same parameters. Scales quite nicely even without tuning. https://usercontent.irccloud-cdn.com/file/v87w55US/histogram.svg
<__monty__> elvishjerricco: Why does the former go up and down?
<elvishjerricco> __monty__: It’s not based on time in any way except the regularity with which you create generations. So although the pattern is very regular, bins don’t approximate the pattern quite right, so sometimes you end up with a blue moon style effect in the bins.
<elvishjerricco> In that case, there must have been a backup at the very beginning of that weird bump period, and at the very end of the period before the gap, and the lifetime difference between generations must have enlarged to just over two months right after the bump.
Jackneill has quit [Remote host closed the connection]
<__monty__> Ah, ok. So you just record a log every time and then keep one every day, week, month, etc. in an exponential distribution?
<elvishjerricco> __monty__: Nope. It’s based on this function: https://www.irccloud.com/pastebin/xnr2HpyW
<elvishjerricco> You give it a constant parameter (I could also change the base from 2 as another parameter, but 2 seems good), and a generation number, and it spits out a number of generations that it should survive for
<elvishjerricco> I’m pretty sure you could prove that this only retains O(log(n)) backups
<elvishjerricco> And the nice thing is that you can change the rate at which you create generations, and you’ll get an extremely similar long term history. i.e. I could decide to switch from weekly to daily and the new backups would end up weeding out so it looks about the same after a few weeks.
<__monty__> How about if you make bursty changes? Let's say 5 on monday, 10 on tuesday, each week?
<eyJhb> elvishjerricco: Might just be me, but labels for x and y would be nice :p
<elvishjerricco> __monty__: I’d have to test that, but I’d wager it’d work out fine
cjpbirkbeck has joined #nixos-chat
<elvishjerricco> eyJhb: k is a constant multiplier (no idea what to call it :P), n is the generation number, and x is the largest power of two less than n
<elvishjerricco> The main reason I wanted something like this over znapzend was that I don’t think booting up a computer for the first time in a year should start deleting most of last years backups.
<__monty__> Sounds like a great idea, yeah.
<__monty__> Did you forget k in the recursive call btw?
<elvishjerricco> __monty__: I did. But I think irccloud let me edit the link
<__monty__> Ah, yep.
<__monty__> I still don't grok it tbh. What does subtracting the greatest power of 2 that fits result in? Wouldn't uneven 'n' always result in 'k'?
<elvishjerricco> Yep
<elvishjerricco> Basically, each generation that is a power of two should have a lifetime equal to k * itself.
Miyu-chan has joined #nixos-chat
<elvishjerricco> And the pattern between 2 ^ n and 2 ^ (n + 1) should be the same as the pattern between 1 and 2 ^ n
<elvishjerricco> So it’s kind of like a self similar fractal
<elvishjerricco> Which is why I believe it’s probably provable that it only retains O(log(n)) backups
<__monty__> Kinda like floats?
<elvishjerricco> Floats like the computer fractional numbers?
<__monty__> Yeah, with 0 being present and the whichever infinity you want being the past.
<elvishjerricco> I don’t follow
<__monty__> The same pattern repeats but scaled up.
<__monty__> elvishjerricco: If it's not too much trouble, could you do a simple point plot of the function with at least one repetition of the pattern?
<__monty__> Can't coerce wolframalpha.
<elvishjerricco> __monty__: I’d have too look up how to create such a plot with the Chart library I’m using :P Will you take `map (lifetimeOf 1) [1..20]`?
<elvishjerricco> `[1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,16,1,2,1,4]`
<elvishjerricco> I guess `[1..32]` would be better: `[1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,16,1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,32]`
<elvishjerricco> And these are the lifetimes, not the expiration times. So `lifetimeOf 1 12` is 4, so the 12’th generation lives for 4 generations before being deleted.
<elvishjerricco> Though I used k = 10 for all those graphs, so 12 would have lived for 40 generations.
<elvishjerricco> But basically, the pattern is: Place each power of two (including 1) in the list at the position equal to itself. After each power of two, repeat all the numbers that came before it until you reach the next power of two.
<elvishjerricco> Then multiply them all by k
tokudan has quit [Quit: ZNC 1.7.3 - https://znc.in]
tokudan has joined #nixos-chat
<elvishjerricco> One more histogram. This is the number of snapshots for each 6 month period dating back 10 years if you take one every 10 minutes: https://usercontent.irccloud-cdn.com/file/UePjAS5m/histogram.svg
<ashkitten> nixos is kinda a trip sometimes
<ashkitten> i just wish there was some sort of bar at the bottom during builds telling me what it's currently compiling, how much more there is left, etc
<ashkitten> it's just kinda awkward that i apply a small patch to nixpkgs and suddenly i'm building gcc, llvm, vulkan, mesa, qt, and systemd
<ashkitten> and i know *why*, i just didn't realize so many packages would be affected
<gchristensen> do you know about `nix-diff` and `nix-top`
<ashkitten> no
<gchristensen> nix-diff compares drv's
<gchristensen> nix-top says what is building
<ashkitten> oh
<ashkitten> still, i feel like there should maybe be some info bar by default when i run nix-build or nixos-rebuild
<elvishjerricco> ashkitten: The `nix` command does that. It just has a single progress bar that shows the most recent line of build output, the phase that build was in, and the number of packages that need to be build / downloaded.
<elvishjerricco> There was a patch to make nixos-rebuild do that, but I don’t remember why it wasn’t accepted. Anyway, you can do `nix build -f “<nixpkgs/nixos>” --no-link && nixos-rebuild switch` to *basically* get it.
<ashkitten> hm
<ashkitten> didn't work
<joepie91[w]> alias rebuild="nix build --no-link -f '<nixpkgs/nixos>' system && sudo nixos-rebuild switch"
<elvishjerricco> ashkitten: What happened?
<joepie91[w]> ashkitten: ^
<joepie91[w]> elvishjerricco: you missed a 'system' I think
<elvishjerricco> Oh, that’s right
<joepie91[w]> ashkitten: once you add the 'system' it should work
<elvishjerricco> ashkitten: Yea, the positional arguments are like nix-build’s -A arguments, and `<nixpkgs/nixos>` returns a bunch of attrs you don’t want to build. `system` is the right one
<ashkitten> hm
<ashkitten> could i do the same with `home-manager switch`?
<joepie91[w]> conceptually, yes; but you'd have to figure out exactly what attribute of what thing `home-manager switch` builds
<elvishjerricco> ashkitten: I use the home-manager NixOS module so that it’s just automatically part of the NixOS switch
<ashkitten> oh yeah, forgot how that works
<ashkitten> er
<elvishjerricco> I think you just add `<home-manager/nixos>` or something to `imports` in `configuration.nix`
<ashkitten> idk how to use that
<ashkitten> oh
<ashkitten> and home-manager is uh
<elvishjerricco> Well
<ashkitten> a channel?
<ashkitten> or
<ashkitten> what
<elvishjerricco> Then you have to point the right NixOS option at your home manager config too
<elvishjerricco> ashkitten: Is home-manager not already a channel on your system?
<ashkitten> i, uh
<ashkitten> no?
<joepie91[w]> ashkitten: anyway, the reason that this 'trick' works is that you essentially pre-build your new system generation using the new `nix build` (which has status output) instead of the old `nix-build`; and so by the time you run `nixos-rebuild switch`, almost everything it would need to build to switch to a new generation is already in the Nix store because of the preceding `nix build`
<ashkitten> it's imported from a url i think
<joepie91[w]> the switch then only takes a bit of time
<ashkitten> joepie91[w]: yeah i know
<joepie91[w]> alright :)
<elvishjerricco> ashkitten: I’m not sure how that would work... You sure it’s not in nix-channel --list?
<ashkitten> anyway i feel like nixos-rebuild should just use nix build internally, but idk how that all works and i don't want to dive into it
<ashkitten> elvishjerricco: programs.home-manager = { enable = true; path = https://github.com/rycee/home-manager/archive/master.tar.gz; };
<elvishjerricco> Oh. So your `NIX_PATH` environment variable has `home-manager=https://github.com/rycee/home-manager/archive/master.tar.gz’ in it?
<ashkitten> uh, no
<ashkitten> it's probably some sort of magic where the system only knows how to build itself because the path is built into the current system
<ashkitten> shrug
<ashkitten> might've initially bootstrapped it through a channel or just built home-manager via that url
<ashkitten> was a long time ago
<elvishjerricco> Yea, I have no idea how your thing is finding home-manager :P Anyway, to make it part of NixOS instead, you'd just figure out how to import `home-manager/nixos`, add it to `imports`, then add the option `home-manager.users.ashkitten.imports = [./home-configuration.nix];`
<ashkitten> ok
<ashkitten> i'll just add home-manager as a system channel and it'll probably work
<__monty__> elvishjerricco: Fwiw, I ran a quick quickcheck and couldn't prove the number of gens retained was ever greater than log2 generation-number.
<elvishjerricco> __monty__: Sweet :) Mind sharing that code?
<__monty__> Uhm, was a short session with lambdabot.
<elvishjerricco> Haha
<elvishjerricco> Shouldn't be hard to figure out myself
MichaelRaskin has joined #nixos-chat
<ashkitten> elvishjerricco: error: The option `home-manager.users.ash.imports' defined in `/etc/nixos/configuration.nix' does not exist.
<elvishjerricco> __monty__: I did prove at one point that http://jekor.com/log2rotate is O(log(n)), but I haven't proven beyond essentially quickchecking that `lifetimeOf 3 n - 1` is actually equivalent.
<elvishjerricco> ashkitten: Did you add `<home-manager/nixos>` to the top-level `imports` in `configuration.nix`?
<ashkitten> yeah
<elvishjerricco> ashkitten: Huh. Maybe try `home-manager.users.ash = { ... }: { imports = [./home-configuration.nix];`? I wouldn't have thought that necessary though
<ashkitten> hmm
<ashkitten> that works
<elvishjerricco> Odd. Oh well
<elvishjerricco> __monty__: I also didn't keep the paper I proved that on, so I don't actually have a proof anymore :P
drakonis_ has joined #nixos-chat
<__monty__> elvishjerricco: We *need* to formalize this in coq or agda, clearly : )
<gchristensen> rewrite the rotater in idris
<elvishjerricco> Haha let me get a math degree first :P
<elvishjerricco> My brother is a physicist, and when I asked him, he said "What you've created is the recursion formula for a discrete fractal. The self-similarity does force the number of surviving generations to be logarithmic."
<elvishjerricco> It was not helpful :P
Drakonis has joined #nixos-chat
drakonis_ has quit [Ping timeout: 264 seconds]
Drakonis has quit [Ping timeout: 264 seconds]
Drakonis has joined #nixos-chat
Drakonis has quit [Ping timeout: 250 seconds]
<joepie91[w]> elvishjerricco: "technically correct but informationally useless" is the term I like to use for this sort of thing :P
<ldlework> vacuous
<joepie91[w]> made a thing tonight
<__monty__> Self portait? : >
<joepie91[w]> well, not exactly, though loosely based on myself because that's the data I have :P
* pie_ looks at scroll
<pie_> what did i miss
<joepie91[w]> pie_: how to rebuild a home-manager-based thing with a progress bar, a picture of my sculpting work tonight, discussion on how to make security updates not awful and slow, and a few other things :P
<pie_> also cool, i wondered about exponential falloff backups at some point
<pie_> joepie91[w], also welcome back havent seen you in a few days :p
<pie_> i need a vacation sigh, im out of a job right now but im basically giving myself work xD
<pie_> lassulus might have been right about just doing nothing
<joepie91[w]> pie_: I've been here? not actually talking maybe because work :P
<joepie91[w]> it's weekend now
<pie_> oh right is weekend
__monty__ has quit [Quit: leaving]
<pie_> joepie91[w], i started redoing r-modules: https://github.com/deliciouslytyped/nix-rer/
<pie_> it look even worse than my other thing right now :D
cjpbirkbeck has quit [Quit: Quitting now.]
Drakonis has joined #nixos-chat
jackdk has joined #nixos-chat
drakonis1 has joined #nixos-chat