-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dae: add support for geolocation databases #244129
Conversation
I recommend adding a NixOS module as an alternative or making some modifications to the upstream unit files. Here are the reasons: dae relies on a geolocation database at runtime. If it cannot be found in hardcoded absoluted path or xdg data dir (May not exist?) it fails to start. This may be hard to handle if install the service directly. See https://github.com/daeuniverse/dae/blob/242bc19e4a8e4d052cb45ab37b76dc556ce692fe/common/assets/assets.go#L71 and #81138. |
I've updated the code to let dae use geolocation databases. It's mostly copied from
I can't really find a nice way to make dae use other databases like |
Considering Maybe adding a nixos module instead is a better choice. |
probably not, see https://discourse.nixos.org/t/how-to-start-systemd-services-provided-by-packages-installed-through-nix-on-an-alien-distro/23056
I agree that a nixos module is better. But it doesn't conflict with shipping a systemd service. For example, the v2ray module and the sing-box module both use the systemd service from upstream:
|
installPhase = '' | ||
runHook preInstall | ||
install -Dm555 "$GOPATH"/bin/dae $out/bin/dae | ||
install -Dm444 install/dae.service $out/lib/systemd/system/dae.service |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps both the installation of the service and the steps in postFixup
can be moved to the postInstall
phase to avoid modifying the installPhase
. Apart from that, it looks good to me.
Result of 1 package built:
|
}; | ||
|
||
postInstall = '' | ||
install -Dm555 "$GOPATH"/bin/dae $out/bin/dae |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this line redundant? (the binary should already be installed in the installPhase)
also installs a systemd service
Description of changes
also installs a systemd service
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)