Just a basic programmer living in California

  • 4 Posts
  • 136 Comments
Joined 3 years ago
cake
Cake day: February 23rd, 2024

help-circle
  • I customized the top bar to resemble Gnome’s. That’s stuff like clock and notifications top-center, control center top-right, using the Cantarell font. It’s definitely not exactly the same. Here’s the config. (It’s written in Nix which generates the Noctalia config file.)

    Some Gnome settings configure GTK which apply to GTK windows in non-Gnome window managers. But you wouldn’t be using Gnome’s control center. You’d use a combination of Noctalia’s control center (handles lots of stuff like wifi, bluetooth, audio inputs & outputs) plus the settings system of whichever window manager you use Noctalia with. The WM will manage stuff like display settings, and key bindings.

    I think xdg support is mostly managed by the window manager? That’s stuff like screen & sharing, file pickers. I use Niri, and it’s got solid support for that stuff. Some of my favorite Niri features are how it handles screen sharing and privacy.


  • Interesting! I didn’t realize the extent to which an ELF is a little database. It does seem worthwhile reexamine our formats from time to time. And yeah, since Nix relies on patching ELFs maybe a better tool for that would avoid some headaches.

    I’m a little unclear of the idea of SELF executables as closures. If we want to avoid duplication of libraries on disk, would that require the one-userland idea? How would a NixOS setup work with all binaries packed into one SELF file?




  • I agree that this doesn’t seem necessary. Personally I think Nix would be a good candidate for dependency management that works consistently between languages. I think that may be partway set up for Haskell, and I’ve noticed that nixpkgs has a good collection of Python dependencies. But for most cases the Nix flow currently usually involves using the language’s bespoke dependency manifest to generate a Nix expression that downloads dependencies from the language’s bespoke package repo.

    One advantage of Nix is that you don’t need all packages in one repo. Nixpkgs is mostly geared for the NixOS Linux distro. Each language ecosystem could have its own repo if that makes the most sense, with Nix being the common connective language.



  • After some reading it looks to me like the biggest difference is that Dashbeam uses an established peer-to-peer system (Iroh), and can operate without servers. Magic Wormhole uses servers instead of a peer-to-peer network to set up connections. Magic Wormhole requires a “mailbox” server to negotiate a connection, and may require a relay server for NAT traversal.

    Dashbeam might also use a relay (I’m not positive about this - relays are described in the Iroh docs, and I don’t know for sure whether Dashbeam uses them). But Dashbeam advertises NAT hole punching that might avoid use of a relay in more situations. That should lead to higher transfer rates since you’re not limited by the bandwidth of a relay run as a public service.

    Dashbeam doesn’t use a mailbox server. The trade-off is that Dashbeam “tickets” are too long to read over the phone, or to type in by hand. Magic Wormhole’s pairing codes are designed to be short for exactly those use cases.

    Dashbeam has mobile apps, it look like Magic Wormhole doesn’t. Edit: looks like there are mobile apps after all!

    So it looks like the advantages of Dashbeam are:

    • potentially faster transfers
    • doesn’t rely on publicly operated servers
    • appeal to fans of peer-to-peer protocols
    • mobile support

    And the downside I see is:

    • you need an existing digital channel to send a ticket to set up a connection

    Compared to some other services, like Pairdrop.net, it looks like Dashbeam might not have automatic local network discovery.


  • I’m using Rust on the server, Typescript on the client. Some very interesting options have appeared in Typescript over time for better ADT handling!

    ts-pattern provides a match function that verifies matches are exhaustive. Yes, it’s a static check. It’s got a powerful matching language that does stuff like extract nested properties from complex inputs, like Rust’s match. I recommend reading the documentation - for me it led to some “I didn’t know that was possible!” moments.

    I’ve also been using fp-ts to get Option and Either types. (Either instead of Result because fp-ts is inspired by Haskell.) It has features for processing fallible values as monads which gets close to the conciseness of Rust’s ? operator and try Trait, but is more generalized. It also has mtl-ish types like TaskEither which roughly serve the purpose of a Promise but with an explicit error type.

    Now that you mention it, must-use detection for Either values would be helpful. Eslint has a built-in check that does exactly that for Javascript’s native Promise type. I haven’t tried it, but it looks like eslint-plugin-fp-ts has a rule that might do the same for other types.



  • I try to capture every detail of the build and test environments in Nix devshells. And where I can I try to encapsulate as much as possible in Nix checks and packages which run in build sandboxes - both locally and on the server. Build sandboxes don’t work for everything, but the devshells alone are great for reproducibility.

    • Wrong interpreter version? A devshell with a flake.lock file ensures every environment is using the exact same interpreter.
    • Accidentally picking up stuff from the local .env? Sandboxed checks and builds don’t get any files that aren’t version controlled, so that’s not an issue. But it’s still an issue with devshells.
    • Accidentally picking up programs or env vars in your environment? Sandboxed builds always get a clean starting environment. If you run nix develop --ignore-env you get a devshell that also gets a clean starting state.

    Nix doesn’t fix everything.

    • File system case sensitivity - depending on where this issue presents (program-generated files vs source files), I use property testing to catch this problem. In fact I was working on exactly that the other day.
    • Timing issues - that’s a good old fashioned hard problem. Try to make logical dependencies explicit. It’s really easy to get implicit order dependencies in concurrent code if you aren’t on guard. In languages that support it promises or futures are good for spelling out what needs to happen in what order.
    • Edit: Difficulty keeping secrets in sync - one option is to use Sops or Age to put encrypted secrets in version control. Then your CI only needs to be configured with one secret to decrypt the other secrets it needs.





  • I think Templates is for cases where you make lots of documents that have the same starting structure. Like a letter head, or a spreadsheet you recreate every month. The starting structure can be saved in Templates so you can copy it ever time you need it. Maybe I’ll put a Nix flake template there instead of always copying from a recent project.

    Public might be for files that other users have read access to on a multi user system? Or maybe for network shares? Or a personal website? I’m not sure. Edit: I found a comment saying that Gnome file sharing uses Public.