gchristensen changed the topic of #nixos-chat to: NixOS but much less topical || https://logs.nix.samueldr.com/nixos-chat
lassulus_ has joined #nixos-chat
lassulus has quit [Ping timeout: 272 seconds]
lassulus_ is now known as lassulus
aszlig has quit [Quit: Kerneling down for reboot NOW.]
aszlig has joined #nixos-chat
lassulus_ has joined #nixos-chat
lassulus has quit [Ping timeout: 268 seconds]
lassulus_ is now known as lassulus
ivan has quit [Quit: lp0 on fire]
harrow` has quit [Quit: Leaving]
harrow has joined #nixos-chat
ivan has joined #nixos-chat
drakonis_ has quit [Remote host closed the connection]
Guanin has quit [Ping timeout: 272 seconds]
Guanin has joined #nixos-chat
__Sander__ has joined #nixos-chat
__Sander__ has quit [Ping timeout: 240 seconds]
__Sander__ has joined #nixos-chat
jtojnar has quit [Remote host closed the connection]
jtojnar has joined #nixos-chat
jD91mZM2 has joined #nixos-chat
<infinisil> jD91mZM2: That looks.. really ugly. Why do it like that?
<sphalerite> heh
<jD91mZM2> oh :(
<jD91mZM2> Any ideas for alternatives?
<infinisil> Sorry :P
<jD91mZM2> Nono, don't be, honesty is good and makes my codez betterz
<infinisil> Hmm.. does rust not allow abstraction of this stuff through interfaces/traits/whatever?
<jD91mZM2> I doubt it, sadly. There's no good way to have a function that both can work on mutable and immutable stuff rather than copy-pasting or macros
<jD91mZM2> and I can't use macros because you can't have repetitions inside nested macros (and I already have a macro)
<gchristensen> I think there is a way, jD91mZM2, you should ask #rust on irc.mozilla.net
<joepie91> not sure I understand the usecase; if you have a chunk of code, then it pretty much inherently cannot work on both mutable and immutable things? either the code mutates and it requires mutable things no matter how you define it, or the code does not mutate and you can take an immutable reference
<joepie91> (and there is no need to support mutable references then)
<jD91mZM2> infinisil: ?
<gchristensen> eh good enogh :P
<jD91mZM2> joepie91: What about modifying the amount of spaces before a node in the AST?
<gchristensen> ack
<jD91mZM2> I can use children() to iterate all metadata
<jD91mZM2> (and child nodes)
<infinisil> jD91mZM2: Well, it's kind of weird to see such an ugly sed command be used to work around something with Rust, which everybody usually praises for its abstractions and stuff :P
<joepie91> jD91mZM2: still not quite seeing how that conflicts with what I said?
<joepie91> infinisil: Rust has zero-cost abstractions; but it is certainly not the most abstraction-permitting language in existence :)
<jD91mZM2> joepie91: Well I need mutability. But it's also incredibly nice to be able to have it work on immutable stuff, especially since I cannot have a proper iterator with mutability because lifetimes :(
<jD91mZM2> infinisil: Ah yes. Your "anything with interfaces/traits/whatever" did get me to think though...
<jD91mZM2> What if I don't macro the function itself but rather helper functions
<infinisil> joepie91: Yeah, Haskell would be more up there, and then there's Idris even higher up
<joepie91> infinisil: JS does quite well on this as well :P
<infinisil> Ack!
<joepie91> jD91mZM2: what is 'immutable stuff' here?
<jD91mZM2> joepie91: The reference to the node itself
<gchristensen> jD91mZM2: why do these functions need to take mutable references?
<jD91mZM2> gchristensen: Well, if you want them to return mutable data
<jD91mZM2> Which I do, so I can modify metadata for formatting
<infinisil> joepie91: (well js can probably do lots of stuff, but only at runtime, no compile-time guarantees, similar to Nix)
<joepie91> infinisil: yes
<infinisil> The "dependent types" in Nix lol
<sphalerite> ugh gitlab doesn't include the file's source on the blob page? >_>
<jD91mZM2> Idea is this: The user may or may not have a mutable reference of the thing
<sphalerite> how am I meant to view the file without javascript :(
<jD91mZM2> If it does have a mutable reference, I want to allow mutating the inner children easily using that function
<joepie91> jD91mZM2: isn't that just a matter of a shared trait for mutable and immutable children, with mutable children having extra functions?
<joepie91> or so
<jD91mZM2> Not really, a trait needs to have the same function signature
<sphalerite> jD91mZM2: I do have a browser with javascript on my big laptop, it was more of a general complaint about gitlab
<joepie91> jD91mZM2: I don't see how this violates that
<jD91mZM2> joepie91: Well I need to take &self for immutable and &mut self for mutable
<joepie91> jD91mZM2: so use &self for shared functions (since those can work with both mutable and immutable things), and &mut self for mutable-thing-specific functions?
Drakonis has joined #nixos-chat
<jD91mZM2> joepie91: I am really unsure what you want me to do
<joepie91> jD91mZM2: I'm unsure where you're seeing a problem :P
<joepie91> like, to be clear, I'm far from a Rust expert, but from what you've described so far this sounds like a fairly standard usage of traits?
<joepie91> and I'm not quite seeing where the mismatch is between what you want to do, and what is supported
<jD91mZM2> joepie91: I want to have both child() and child_mut() functions. I can do this by copy pasting or having a macro generate both problems.
<jD91mZM2> s/problems/functions
<jD91mZM2> child_mut() so my formatter can modify the metadata and amount of space
<jD91mZM2> child() so it'll still work on immutable references, AND we get a real nice children() iterator
<joepie91> jD91mZM2: I have some thoughts on this that I can't quite formulate right now :P it's getting hotter here and it's affecting my thought processes...
<jD91mZM2> Even the standard library is having this issue, somewhat
<jD91mZM2> Iter, IterMut, IntoIter
<jD91mZM2> Copies for each type of reference, or owned
<gchristensen> joepie91: nice.
mmercier has joined #nixos-chat
<jD91mZM2> nix-lsp just got basic auto-indention formatting
<jD91mZM2> Very basic
<jD91mZM2> If anybody wants to take over development of nix-lsp to actually make stuff not "very basic", I'd be glad to give it over. I don't really find it too fun to implement stuff
* LnL prepares to put the the next step of his secret plans into motion
<gchristensen> uh oh
<LnL> some people at work are starting to write nix expressions now
<gchristensen> muahahaha!
<gchristensen> can I send you (and them) stickers? :)
<LnL> exactly :D
<LnL> oh, sure if you want
<LnL> I should also get a bunch of nix-darwin stickers before nixcon
<joepie91> perfected my almost-oil-less pancake baking process
<joepie91> few drops of oil at the start of the batch, zero oil after that
<joepie91> \o/
<gchristensen> no butter?
<joepie91> nope
<gchristensen> but why /o\
<joepie91> because easier and tastier :P
<gchristensen> not-sure-if
<joepie91> I do add a little more egg to keep them from becoming dry
<joepie91> also, Dutch pancakes, so thin ones
<joepie91> I suspect this wouldn't work with eg. american pancakes
<LnL> is it supposed to look like that?
<gchristensen> I know that to be a "dutch baby"
<gchristensen> but to make that you need a lot of butter
<LnL> kind of looks like my first failed attempt at cheesecake
<gchristensen> oh by the way, what were you cooking the other day?
<LnL> one of the things was my second attempt at cheesecake, which was a success :D
<gchristensen> yay!
<LnL> and sushi
<gchristensen> you made sushi?
<jD91mZM2> Unrelated, but I am fairly certain I am getting ZFS or BrFS or something like that next weekend! My root is filling up so fast I can't delay it much longer (:
<jD91mZM2> s/BrFS/BtrFS/
<gchristensen> will zfs / btrfs save you space somehow?
<gchristensen> I guess I'm asking why does your root filling up add pressure to your timeline :)
<jD91mZM2> Maybe, with encryption, but mainly I just need to reformat with some kind of dynamic partitioning
<joepie91> gchristensen: no, not like that at all :P
<jD91mZM2> compression*
<jD91mZM2> I am bad at words
<gchristensen> LnL: those are beautiful! I've never had the guts to do it.
<joepie91> though mine are colored very differently due to my process
<gchristensen> oh nice
<samueldr> here we call those crêpes
<joepie91> flat brown-ish on one side, mostly yellow with brown 'veins' on the other side
<joepie91> samueldr: these are a little thicker than a crepe would typically be
<samueldr> oh
<samueldr> (harder to gauge on a picture I guess)
<LnL> gchristensen: not actually that hard, the rice is basically the only difficult part
<joepie91> samueldr: especially because they taper off a bit
<joepie91> so the edges look thinner than the rest of the pancake is
<joepie91> crepes are just thin everywhere
<joepie91> though it'll probably depend on who you ask :P
<jD91mZM2> Welp, I might not even be able to nixos-rebuild switch --upgrade... It's really full
<infinisil> jD91mZM2: Yeah, compression is very nice, makes my /nix/store over 2 times smaller]
<jD91mZM2> gchristensen: But yeah I could also just go with either resizing my partitions once more, or even LVM. But for LVM I still need to wipe my disk, so might as well take ZFS
<jD91mZM2> infinisil: Oh yeah, ZFS had 2x something compression
__Sander__ has quit [Quit: Konversation terminated!]
<infinisil> It depends on the dataset
<jD91mZM2> Of course
<gchristensen> gotcha
<infinisil> Overall I only have a 1.07 compressratio
<jD91mZM2> Oh
<infinisil> Because most of my pool is movies and series :)
<infinisil> (which can't really be compressed any further)
<gchristensen> infinisil: you might consider making a new pool with compression disabled and move your movies and series to it.
<jD91mZM2> I heard Google is working on some really cool compression for ChromeOS
<jD91mZM2> Basically it can take almost anything to 0GB
<infinisil> gchristensen: Or just a different dataset
<jD91mZM2> It does this by putting all your data on their servers
<infinisil> jD91mZM2: Lol
<gchristensen> oh sure
<jD91mZM2> WELL, root is now 0b availabl
<infinisil> I don't like the idea of (a) google having all my data (b) not being able to access all my data without internet
<jD91mZM2> I think I can give up on doing a system upgrade
<gchristensen> joepie91: btw I bought a 15-drive chassis and 2x LSI raid controllers which can be reflashed to just be sata expanders :|
<joepie91> gchristensen: one of us, one of us, one of us...
<joepie91> :P
<gchristensen> I idled in your channel for a half day, it was too much
<joepie91> heh, keep in mind that #datahoarder is heavily off-topic
<infinisil> Ohh I should join that, I want to build a small storage array soon (tm)
<gchristensen> joepie91: I got a single 6TB drive for it, so I don't think I'm "one of you" yet
mmercier has quit [Ping timeout: 265 seconds]
<joepie91> gchristensen: ... yet
<joepie91> :D
<samueldr> I know I'm not a data-hoarder since I bought my first TB-scale drive this year... and it's sitting nearly empty
<joepie91> I... may have a combined 13TB of storage...
<gchristensen> _my_ amount of data is very small. _my_ amount of data fits in less than 500G. My brother, though, has a real appetite.
<joepie91> what does he hoard anyway :P
<gchristensen> not my department
<joepie91> lol
<infinisil> Haha
mmercier has joined #nixos-chat
<jD91mZM2> ([] + [][{}])[!!{} + !{}] + ({} + [])[!!{} + !{}]
<jD91mZM2> Behold, the string "no" in JavaScript
<jD91mZM2> Yep, that's where I got the idea from
<jD91mZM2> Also http://www.jsfuck.com is worth mentioning, for generating very similar strings
<jD91mZM2> Can even eval code :^)
<jD91mZM2> ZFS people here, are there any good tutorials which don't just give you commands to run but also explain them better?
<jD91mZM2> https://nixos.wiki/wiki/NixOS_on_ZFS mentions "raid mirror" and I have no ideawhat that is
Drakonis has quit [Remote host closed the connection]
<maurer> raid mirror is equivalent to raid1
<jD91mZM2> which is?
<maurer> basically, it'll keep a copy of every block on both disks
<maurer> tl;dr
<maurer> If you have two drives and want to go fast, do striping
<jD91mZM2> Oh, so I have no reason to have that? The NixOS example does it for /boot for some reason
<maurer> If you have two drives and want to keep your data, use mirror
<maurer> the nixos example does it for boot because there are no other raid modes that would be compatible with boot
<jD91mZM2> But why RAID at all?
<maurer> So you don't lose your data mostly?
<jD91mZM2> Can I keep boot as a normal partition?
<maurer> Yes, you can
<jD91mZM2> And basically have EFI partition + ZFS
<maurer> Yes, that works fine
<maurer> What they are doing there is saying "We have 4 devices anyways, and boot isn't big, might as well keep backup copies of boot on every drive in case of failure"
<jD91mZM2> Are zfs commands available from the installation CD? If I want to reinstall with ZFS, do I boot into there, format and nixos-install?
<maurer> I believe they were there last time I tried
<jD91mZM2> maurer: Ah, right. I just have 1 device I believe
<maurer> Note - what they are doing to boot there is _unrelated_ to zfs
<maurer> They are setting up a traditional linux md-raid
<jD91mZM2> Oh ok
<jD91mZM2> Which brings me to what I started the conversation with: Are there any good tutorials anywhere?
<jD91mZM2> That for example don't do RAID stuff
<jD91mZM2> BTW apparently nix-store --optimise REALLY helps with my disk usage
<jD91mZM2> It went down from 93% to 80% used
<gchristensen> jD91mZM2: this whole series:
<gchristensen> jD91mZM2: what disks do you have available?
<jD91mZM2> Only one, I believe
<jD91mZM2> Thanks for that btw, it's already quite helpful
<jD91mZM2> > You cannot shrink a zpool, only grow it
<{^_^}> error: syntax error, unexpected ',', expecting ')', at (string):171:26
<jD91mZM2> Oh whoops
<jD91mZM2> Might just give it half the disk to start off, then
<gchristensen> that is probably the most concise and informative thing I've read about NixOS
<gchristensen> erm
<gchristensen> ZFS
<jD91mZM2> BtrFS looks better integrated? It uses mkfs.btrfs, and can be added to fstab, etc?
mmercier has quit [Ping timeout: 240 seconds]
<srk> I do host images with zfs enabled if you can boot from boot.vpsadminos.org
<srk> otherwise it's just a rebuild of live cd with altered supportedFilesystems
<jD91mZM2> Oh, BtrFS doesn't have pools like ZFS?
<jD91mZM2> (Honestly, I kinda like that. Then I can leave that up to LVM, a separate tool)
<gchristensen> hrm
<gchristensen> "2018-08-20 15:50:06 jD91mZM2 gchristensen: But yeah I could also just go with either resizing my partitions once more, or even LVM. But for LVM I still need to wipe my disk, so might as well take ZFS"
<jD91mZM2> gchristensen: When I said that I was thinking of LVM+ext4
<jD91mZM2> which of course brings me no checksums and cool stuff
<gchristensen> ah
<jD91mZM2> Now I'm just thinking about whether to use BtrFS or ZFS
<LnL> I can't judge because I've not used both, but I still hear about weird BtrFS issues from time to time
<jD91mZM2> oof
<gchristensen> my experience with btrfs was several years ago, so I'll not say anything
<jD91mZM2> That settles it, I'd say. Just wish ZFS wasn't so difficult to understand
<jD91mZM2> gchristensen: Outdated knowledge > no knowledge
<gchristensen> it isn't so difficult, spend an hour reading those blog posts linked from that page I sent you and you'll have a good working knowledge
<jD91mZM2> It's hard not to get distracted :^)
<jD91mZM2> Just double checking: `zpool create tank sde` is the same as `zpool create tank /dev/sde`, right?
<gchristensen> samueldr: I chose bash.
<infinisil> jD91mZM2: Yup
<samueldr> gchristensen: bash chose you
<gchristensen> aww
* samueldr wonders what that was about
* jD91mZM2 heads off to bed
jD91mZM2 has quit [Quit: WeeChat 2.0]
<joepie91> for those interested in visual/flow programming: https://xod.io/
<joepie91> this is extremely close to what I was working on in this area
<makefu> joepie91: this looks remarkably similar to nodeRED, no?
<joepie91> makefu: the major difference is that unlike nodered, which is a) horribly buggy and b) very basic, xod is extremely well-thought-out and works well
<makefu> well, that is actually an advantage
<makefu> and it seems to run directly on the uC
<joepie91> makefu: like, there's a bunch of visual programming things, but they all fail on the point of being 'toys'; they try to do programming 'without needing to learn programming'
<joepie91> this makes them unsuitable as a 'real' replacement for text-based languages
<joepie91> xod doesn't do that :P
<joepie91> there's actual language design going on here
* joepie91 is very excited
<joepie91> as far as I can tell, this project is on the exact same path that I was traveling wrt visual programming design, except they're further ahead
<simpson> "You’re protected against creating programs that don’t compile. If it links, it’s likely going to work." I've heard this before~
<makefu> every c program ever
<joepie91> going to give xod a spin at the local hackerspace tomorrow
<makefu> great, i will also check it out
<joepie91> and from what it looks like now, I'll probably end up contributing lol
<makefu> esp8266 support would be nice out of the box. these small boards are the future of entry-level iot
<makefu> or actually the present
<joepie91> makefu: it has that
<joepie91> also it can export as arduino-IDE-compatible code so it should work with any microcontroller that has an Arduino compat layer really
<makefu> awesome
<joepie91> (in theory anyway)
<infinisil> joepie91: Neat!
<infinisil> I really want to get away from text-based programming, am always excited about such projects
<infinisil> But I have a feeling that the future will be an AST editor, and not this connect-parts-together thing
<infinisil> AST editor as in: It will look almost the same as text, but the editor only does AST-aware modifications upon your commands
<makefu> as always
kalbasit[m] has quit [Ping timeout: 256 seconds]
infinisil has quit [Ping timeout: 256 seconds]
infinisil has joined #nixos-chat
<gchristensen> samueldr: my project has outgrown bash, I know this because of how much piping and sed I've used
<samueldr> it hasn't; see how much you're using sed and pipes to expand beyond bash
<samueldr> 😼
* gchristensen has left #nixos-chat
<joepie91> lol
<samueldr> (though you're most likely right that you're outgrowing bash)
<samueldr> I feel the name of the track is relevant
<joepie91> lol
<joepie91> pmusic is a work of art, though
<gchristensen> the weird thing is pmusic can only play music about major mistakes
<joepie91> hahaha
Drakonis has joined #nixos-chat
Drakonis has quit [Remote host closed the connection]
<gchristensen> accidentally fail2ban'd myself with encryptedLinksTo :$
{^_^} has quit [Remote host closed the connection]
{^_^} has joined #nixos-chat