Just a basic programmer living in California

  • 7 Posts
  • 64 Comments
Joined 10 months ago
cake
Cake day: February 23rd, 2024

help-circle
  • hallettj@leminal.spacetoLinux@lemmy.worldTips for kid workstations
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    18 hours ago

    I set my kid up with Silverblue recently. After seeing it in use for a bit, as a power user I think it’s got some obnoxious compromises, and NixOS is a much better way to get the same benefits, and encourages safe experimentation at every level of the system. But for a beginner-friendly system that is very stable I think ostree distros like Silverblue make sense. Mostly stuff works fine, but you want to break out rpm-ostree occasionally to get a native package.

    I have another kid on Fedora as a control. So far things are fine. Previously I had both kids on Manjaro, but they weren’t able to keep up with upgrades long-term (over the course of a few years) without some intervention from me.

    Like I said in Silverblue stuff mostly works nicely:

    • Bottles running from Flatpak is running games in Battle.net without problems
    • Minecraft is running from the launcher installed from Flatpak
    • Roblox is running using Sober from Flatpak

    I think we may have installed steam natively using rpm-ostree. I think we ran into some sort of issue running Overwatch, and I quickly opted for the native steam package to get things working instead of trying to fix the issue using Flatseal. But I don’t remember what that issue was so I can’t say the Flatpack steam won’t just work for you. Maybe it was very slow Vulkan shader processing?

    My kid likes Minecraft mods so he needed java in his path to run installer jars. AFAICT in immutable distros the options for setting up CLI programs are either to run a different distro with native packages in a container (distrobox), or drop to rpm-ostree. I opted for the latter.

    On the hardware side I think one of the biggest factors in building a snappy system is choice of SSD. Like you said, spinning metal is out. But the idea that SSDs are all equal is a common misconception. The thing to do nowadays is to use an M.2 form factor which is where you get a little board that goes into a slot directly on the motherboard, sort of like a small, sideways RAM stick. That plugs directly into the PCIe bus which gives it tremendous bandwidth. Drives that support newer PCIe versions can be faster due to having access to more bandwidth, but the design of the drive itself is also a constraint.




  • Docker Compose runs services, manages dependencies between services, isolates each service in a container, manages a private network. Out-of-the-box flakes don’t do any of that - except arguably running one service at a time. What flakes do is build software, which is the thing that Docker Compose doesn’t really do. (Or doesn’t do well.)

    I’d compare flakes to Makefiles with waaay more expressiveness and reproducibility. Or maybe a comparison could be to a Dockerfile, minus containerization, with waaay more expressiveness and reproducibility.

    There are tools you can add on to get Nix to do what Docker Compose does:

    Arion is a Nix frontend for Docker Compose. You’re still using Docker Compose, but it layers on the extra expressiveness and reproducibility of Nix flakes, or other kinds of Nix expressions.

    process compose flake is similar, but instead of Docker Compose it is a frontend for Process Compose. You get a similar result, but without containerization. That can potentially avoid the need to run in a VM on non-Linux systems that don’t natively support containers.



  • Question, changing the OS on the deck, do you still get all the updates to steam and everything?

    Yes, I think so. I haven’t used SteamOS, but it seems like it gives you Steam, and exactly the right drivers for the Steam Deck? Steam is packaged for basically every distro, and you get the same experience everywhere, including “big picture mode” if you opt into that. Bazzite is designed with the Steam Deck in mind so it should have the right drivers.








  • When I researched this previously I concluded that there are two very good options for regular backups: Borg and Restic. These are especially efficient at backing up a diff of what has changed since the last backup. So you get snapshots of your filesystem state at each backup point without using a huge amount of space. You can mount any snapshot as a virtual directory. After the initial backup, incremental backups take a minute or two.

    I use Borg, and I back up to cloud storage on Borgbase. I use Vorta as a GUI for Borg. I have Vorta start automatically when I start my window manager, and I have it set up for daily backups. I set up the same thing on my kid’s computer.

    I back up my home directory. I have some excluded directories like ~/.cache, and Steam’s data directory. I use Baobab to find large directories that I don’t want backed up.

    I use the “exclude caches” option in the Borg “create archive” settings. That automatically excludes Rust target/ directories because they follow the Cache Directory Tagging Specification. Not all programming languages’ tooling follows that spec so I also use directory name pattern excludes. For example I have an exclude pattern for .*/node_modules/.*

    I use NixOS, and I keep my system config in a git repo so I don’t need backups for anything outside my home directory.



  • Probably not very similar, but Git Butler is very interesting. It adds its own layer of management so that you can have multiple branches “applied” to your working tree simultaneously. It’s helpful when you have multiple changes that should go into different branches, and some that shouldn’t be committed - it has a system of lanes that help keep track of all that. Or you can test how changes from two branches interact.

    Last time I used it, maybe 6 months ago, it was rough around the edges so I didn’t stick with it. But they’ve done lots of work since then so I’m thinking of giving it another go. It is (last I checked) an all-in tool. When you’re using Butler on a project you probably won’t be able to use other git tools.


  • I think it depends. Lua is great for scripting - like when X happens do Y. I agree that makes sense for a case like Home Assistant. Sometimes you really want the result to be a data structure, not an interactive program, in which case I think more sophisticated configuration (as opposed to scripting) languages might be better.




  • hallettj@leminal.spacetoProgramming@programming.devWhy YAML sucks?
    link
    fedilink
    English
    arrow-up
    13
    ·
    edit-2
    3 months ago

    I agree - YAML is not suitable for complex cases that people use it in, like Terraform and Home Assistant. My pet peeve is a YAML config in a situation that really calls for more abstraction, like functions and variables. I’d like to see more use of the class of configuration languages that support that stuff, like Dhall, Cue, and Nickel.

    There is another gotcha which is that YAML has more room for ambiguity than, say, JSON. YAML has a lot of ways to say true and false, and it’s implicit quoting is a bit complex. So some values that you expect to be strings might be interpreted as something els.




  • To expand on why generics are preferred, just in case you haven’t seen these points yet: the performance downsides of Box<dyn MyTrait> are,

    • methods use dynamic dispatch in this case
    • requires heap allocation

    There is also a possible type theory objection which is that normally there is a distinction between types and traits. Traits are not types themselves, but instead define sets of types with shared behavior. (That’s why the same feature in Haskell is called a “type class”, because it defines a class of types that have something in common.) But dyn turns a trait into a type which undermines the type/trait distinction. It’s useful enough to justify being in the language, but a little unsettling from a certain perspective.