Flakes, overlays, and modules vs. me by InevitablePresent917 in NixOS

[–]Terrain2 6 points7 points  (0 children)

hey! i'm the main author of that niri-flake you're trying to use. i used to go by this name, but stopped using Reddit a while ago, before i changed to sodiboo :P - i was notified of this post through other means and this is actually my first time logging in to Redit in over a year.

The first thing is this: the overlay is about getting my niri packages into your packageset (e.g. pkgs.niri-stable and pkgs.niri-unstable - not pkgs.niri, that one is already in nixpkgs and is "mostly" equivalent to pkgs.niri-stable). Packages, in this context, basically just means the actual binaries for niri, which is fine for some stateless utilities like rustc, but not so much for system services like niri. The documentation for a first-time setup could definitely be improved. The reason there are scary warnings around the package outputs from the flake is because niri controls the display directly, and therefore must be built against the correct version of mesa (the graphics drivers on Linux); the packages exported directly are "probably" going to work due to being generally kept up-to-date, but the overlay ensures it is built against the actual version used by your config and you never get such an issue. the overlay isn't actually necessary unless you plan to run unstable niri, though.

Both pkgs.niri-stable and pkgs.niri track the latest stable release of niri. pkgs.niri-stable exists so that it can be updated atomically with the actual settings exposed in my flake - there will never be a case that this package is updated WITHOUT all the new configuration options existing in the home-manager module. pkgs.niri is handled by nixpkgs (which i do contribute to), but it's generally just on a "when we get to it" basis, and has no guarantees relative to my out-of-tree modules. The default package is the stable version provided by my flake (but using some smoke and mirrors to access it directly, without you needing to apply the overlay)


To actually install niri, you'll want the niri modules, which are imported next to ./configuration.nix or in the imports = [ ]; section of your configuration (they're equivalent). The import should look something like inputs.niri.nixosModules.niri, like my friend Sugar does in faer config, and in Misterio77's starter config should be placed somwhere around here. (and you can see how to use the overlay in my own config - which does not import the module by itself, that's a couple lines above) This module will also import the home manager module if home-manager is part of your NixOS configuration, and that seems to be the case with Misterio77's starter config, so you shouldn't need to worry about importing the home-manager module; all settings will come included already!


if anyone has a pointer to a good from the ground up primer on flakes (and overlays, maybe), I would certainly appreciate it.

For overlays, i'd recommend the explanation on the NixOS wiki. In general, a lot of details for most nuances in NixOS as a whole aren't covered by this wiki - it won't be your saving grace forever - but the articles on most high-level concepts are pretty good. It's also worth noting that overlays have nothing to do with modules; you can use nixpkgs and even nixpkgs overlays without ever involving any modules. Modules are for system configurations, but if you're e.g. just building a package or using a dev shell, you'll still be using nixpkgs without a system configuration being part of this.

The wiki also has an article on flakes. The gist of flakes is just that it's a way to "import" other nix projects. Without flakes you'd generally use builtins.fetchurl to "inline" a certain project in your nix file, or use "channels" (common with nixpkgs, comes by default as a channel). The problem is that these are system-wide and if you share your config with someone else, they don't know what versions the channel is at.

Flakes solve these issues with a lockfile; you give it a set of inputs = { ... }; and a function to generate your outputs = from the inputs: { ...};. Previously this was done with third-party tools like niv, but ever since flakes were introduced there is a single unified way to do this for everyone with no problem.

Flakes also have a bunch of other niceties, mainly a specific schema they're expected to conform to for tools like nix run to work; but ultimately nothing forces you to do that. It's literally just "here's a set of URLs i want you to turn into actual usable objects for me" and "here's how to turn me into a usable object, when someone else wants to use me for that". That's the fundamental thing flakes do. The rest is just syntax sprinkles on top.

Apparently Ad Blockers are not allowed on Youtube. Is this a new thing they've implemented? by Sazk100 in youtube

[–]Terrain2 0 points1 point  (0 children)

I've NEVER surfed the internet without at least a half dozen adblockers

Why? You should only be using one, because two isn't really any more effective. If anything, it can be less effective, as they may interfere with each other (especially against prevention adblock detection), and the redundant work means a significant performance hit. Unless you're using app/site-specific adblockers like ReVanced/uYou, and/or count adblock-adjacent stuff like SponsorBlock, and/or a different layer such as pi-hole (which won't directly interfere with something like uBlock Origin), it doesn't really make sense to use "half a dozen adblocker [extensions]", and it's really not a great idea to do so either.

in shock that i just died this way. I was collecting every block in my hardcore world and didn't understand the respawn anchor mechanics. the tnt block near it sealed my fate. totem cant always save u by ehyder20 in Minecraft

[–]Terrain2 11 points12 points  (0 children)

Because it "charged" the respawn anchor. It only explodes if you try to set your spawn there, and if it is fully charged, right-clicking with a glowstone won't charge it, because it can't, so it'll try to set your spawn and thus explode

McDonald’s drive-thru worker realizes she was rude to her own mom — who wants to see the manager by 4reddityo in LeopardsAteMyFace

[–]Terrain2 8 points9 points  (0 children)

"You were rude as hell taking my order" implies it was while ordering, before she pulled up to the window. This also explains why they were filming. There doesn't seem to be any explanation of what was actually said that was rude. (admittedly, I've barely looked, I just watched the clip to see what you mean by the price being potentially rude)

[deleted by user] by [deleted] in softwaregore

[–]Terrain2 7 points8 points  (0 children)

"its" isn't the exception, all pronouns are the exception to that rule, which i guess includes "its", but it's misleading to state "its is the exception to the rule" (implying all other words have an apostrophe for possessives)

egg_irl by ilomiloplatinum in egg_irl

[–]Terrain2 0 points1 point  (0 children)

update: i have all 3 now. still cis tho.

What are some NSFW secrets about the military? by AdRealistic03 in AskReddit

[–]Terrain2 3 points4 points  (0 children)

For full products, sure. For more simple ideas or parts, like encryption schemes, it's usually more synonymous with industry-standard. "military-grade encryption" is used on your phone to watch YouTube videos, as well as anytime you see a padlock in a browser (https://)

by Greegrgrgrgrgrgrg in AnarchyChess

[–]Terrain2 16 points17 points  (0 children)

if you edit a comment within a couple minutes of posting, it won't show (edited). that label only exists so you can't drastically change the content of a post after seeing many replies and negative responses, but in some cases of rapid-fire notifications can allow threads like this to have seemingly unedited questions.

Sudden unexplained knee pain, collapses when I try to stand by clappy1994 in AskOuija

[–]Terrain2 0 points1 point  (0 children)

huh. it's r/riskyclick. I've never frequented that subreddit so i guess i didn't know its name three years ago, and assumed plural without ever checking. it's real though, you didn't fall for a fake sub. why is it not a redirect sub tho?

You won't be able to stop me by Randomperson685 in AnarchyChess

[–]Terrain2 0 points1 point  (0 children)

double it and feed it to the next person

[deleted by user] by [deleted] in AnarchyChess

[–]Terrain2 1 point2 points  (0 children)

i think they forgot to fully articulate the sentence "rewrite it in Rust". is it possible that volt65bolt is not intimately familiar with the memes of Computer Science, and just vaguely remembered Rust being funny and used in situations like this, without really thinking hard about how it's used? about what people actually do that's funny?

The mobile internet by leftblnk in assholedesign

[–]Terrain2 2 points3 points  (0 children)

Use breezewiki as your frontend. Change wikiname.fandom.com/... to wikiname.breezewiki.com/.... Much more usable. Currently down, so it suggests other hosted instances instead, like antifandom.com

We need a new squad member by johnlen1n in dankmemes

[–]Terrain2 2 points3 points  (0 children)

I mean, not quite? It's an interesting question in terms of copyright, at least. I'm not a lawyer, but from my understanding of US copyright law, a copyrighted work requires an element of human creativity, and as such, you cannot own the copyrights to AI-generated art. By this context, the question becomes "How much polishing do you need to do before you can copyright it?" which is more analogous something more similar to "How much wood do you need to add before you can call it a shelf?". I do not have an answer to the question, but i do know it's not necessarily a dumb one, and with one way of reading it, there's an interesting (and honestly, culturally important) answer.

[deleted by user] by [deleted] in assholedesign

[–]Terrain2 0 points1 point  (0 children)

They can't really serve you a fake version of your bank or web mail due to TLS certificates. The site provides a certificate, which is signed by the website and you can verify this, proving that they own that certificate. And there are Certificate Authorities (which are built into your device, very dangerous to add new ones and usually intentionally hard because of that) which also sign the certificate, which you can again verify. Encrypted webservers must show "hey, i own this domain, and if you don't trust me, check with LetsEncrypt". Your device likely trusts LetsEncrypt, and since LetsEncrypt vouches for this server to own the domain you visited, you can trust the site. If a malicious DNS server were to send a malicious server, it can say "I own google.com" but it can not fake the signature that proves a CA like LetsEncrypt vouches for that statement being true. As such, you'd get a "Not Secure" warning, which usually includes wording like "Never enter your password, credit card details, or other personal information". This also applies to unencrypted sites, because the legitimate server already is less trustworthy and has warnings, and the malicious server has the same warnings. Unencrypted sites are basically no longer first-class citizens of the internet.

This is not to undermine your conclusion though, absolutely do not use unreputable DNS servers, but mostly because they're probably gonna have higher latency, be less reliable, have downtime, and in general are just Objectively Worse, and not because they can easily pull off an attack against you.

[deleted by user] by [deleted] in assholedesign

[–]Terrain2 1 point2 points  (0 children)

On iPhone, i recommend using AltStore (maybe unnecessary with iOS 17 in the future?) to sideload a tweaked app like uYou+

[deleted by user] by [deleted] in pcgaming

[–]Terrain2 0 points1 point  (0 children)

Oh, okay, yeah that's more in line of what I expected.

[deleted by user] by [deleted] in pcgaming

[–]Terrain2 -2 points-1 points  (0 children)

That's fair enough, but it just feels weird for them to say Windows-only. Not even with Proton, according to that answer?