When to use default.nix, e.g.: hyprlock

The ‘hyprlock’ GitHub repo comes with a sample default.nix. What are default.nix files used for? It looks like a list of packages. Is this configuration file only required if I were using Flakes? Or can I get away with just invoking this list of packages as regular nixpkg names in my configuration.nix without having to handle this suggested default.nix? My concern is that Flakes pull packages closer to the latest bleeding edge upstream releases and in comparison stable or unstable channel packages that serve as dependencies for hyprlock could present incompatibilities or required packages which are slightly out of date.

Literally anything. Could be a module, package expression, an expression that points at a package expression… hence one motivation for flakes was to standardise the interface a bit. Either way you would have to read the code to know what it does, anyway.

In this case it’s a package expression, which can be callPackage-d. More on that at Package parameters and overrides with callPackage — nix.dev documentation.

Other than that this seems like the same question as in Managing package repos - - `stable`, `unstable`, Flakes