My first nix package! Open to feedback :)

Hi! I’ve recently created my first ever nix package: remember-the-milk-nix! It’s just an electron app, and was admittedly made with the help of AI. But because of it’s relative simplicity I think it works well enough and I’ve read through all the code and documentation. If people would have the time to peek at it, I would love some feedback!

One thing in it I’m a bit concerned about is that on non-nix systems it fails to launch without a nixgl wrapper. I played around for a bit and am not sure if I’m doing something wrong, but for non-nixos systems it requires the launcher to run properly.

Along with this, forever ago I made some packages and modules for the Grimmory application (then called Booklore). It worked mostly but did not have a configurable port because it’s build was intended for docker. Would love to know if anybody randomly might know some tricks I could use to get around it. Old code linked here. Thank you in advance :slight_smile:

2 Likes

This is normal, you aren’t doing anything wrong. default.nix I would change: typically you’d expect to see a { pkgs ? import <nixpkgs> {} }: arg as well as the system one, let the user pass their pkgs instance, or source it from the NIX_PATH.

Gotcha, thanks for the feedback. For:

arg as well as the system one

I would be doing { system ? "x86_64-linux” }: then? I imagine x64 would be a reasonable default?

This will use the builtin system by default. If the user wants to build for a different system, they would instantiate nixpkgs for that system and pass that in to the function. So, you don’t need need a system arg at all. That said, you probably want to interpolate the current system into this line so that you download the correct binary.

Thanks for the feedback! I believe it’s using the system defaults for pkgs and system now, and can download the 64 or 32 bit binary for the respective architectures. But if anyone would like to validate I would love to know I’m doing things correctly :slight_smile:

1 Like

Looks good to me :+1:

1 Like