I sometimes write a flake with those 4 lines of Nix code, and it comes out just messy enough that tbh I'm happier adding an input to handle that. But I recently learned that the nixpkgs flake exports the lib.*
helpers through nixpkgs.lib
(as opposed to nixpkgs.legacyPackages.${system}.lib
) so you can call helpers before specifying a system. And nixpkgs.lib.genAttrs
is kinda close enough to flake-utils.lib.eachSystem
that it might make a better solution.
Like where with flake-utils you would write,
flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-darwin" ] (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
hello
];
};
})
Instead you can use genAttrs
,
let
forAllSystems = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-darwin" ];
pkgs = forAllSystems (system:
nixpkgs.legacyPackages.${system}
);
in
{
devShells = forAllSystems (system: {
default = pkgs.${system}.mkShell {
nativeBuildInputs = with pkgs.${system}; [
hello
];
};
});
}
It's more verbose, but it makes the structure of outputs more transparent.
That sounds like a good learning project to me. I think there are two approaches you might take: web scraping, or an API client.
My guess is that web scraping might be easier for getting started because scrapers are easy to set up, and you can find very good documentation. In that case I think Perl is a reasonable choice of language since you're familiar with it, and I believe it has good scraping libraries. Personally I would go with Typescript since I'm familiar with it, it's not hard (relatively speaking) to get started with, and I find static type checking helpful for guiding one to a correctly working program.
OTOH if you opt to make a Lemmy API client I think the best language choices are Typescript or Rust because that's what Lemmy is written in. So you can import the existing API client code. Much as I love Rust, it has a steeper learning curve so I would suggest going with Typescript. The main difficulty with this option is that you might not find much documentation on how to write a custom Lemmy client.
Whatever you choose I find it very helpful to set up LSP integration in vim for whatever language you use, especially if you're using a statically type-checked language. I'll be a snob for just a second and say that now that programming support has generally moved to the portable LSP model the difference between vim+LSP and an IDE is that the IDE has a worse editor and a worse integrated terminal.