-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
nixos/miniflux: vendor & use upstream systemd service #325037
Conversation
wow upstream has such a nice |
Seems simple enough, but that would require me to change the derivation for miniflux to also ship the systemd service unit. Should I repurpose this PR? Also, I am not entirely convinced if systemd.packages is actually a better approach. What if the user wants to override the unit, how is that handled under systemd.packages in comparison to the service config set that can be overriden? |
if you're willing to that would be great!
you're entirely about to override everything in the unit without significant difference - and no one knows upstream better than upstream! they really ship a good unit so to me it is a clear win to utilize it |
What if the end-user wants to change service settings, though? From the top of my head I can think of a case where the user wants to de-harden the service, or try to change its wants or after (e.g. for Postgres). Does systemd.packages allow overriding for such cases? |
yes |
That's good to hear, I'll proceed with the change tomorrow morning. Until then, would you mind telling me how the unit settings are overriden? |
for sure as a quick example to override
this follows |
1a82cb6
to
955ac57
Compare
03588da
to
0d5fb29
Compare
@aanderse I've repurposed to PR to 1. vendor the upstream service and 2. use it in This is my first time using systemd.packages for a service however, and I am not sure how to resolve the failing test with |
e4e6155
to
4b199f1
Compare
I've pushed some change to hopefully bring the service on par with the desired hardening status. Though I still can't seem to figure out why the NixOS test is failing for me, logs indicate that it's something to do with KVM modules in my kernel but I'd appreciate someone testing to see if it's failing for them as well. |
|
4b199f1
to
cbbd91d
Compare
Test seems to be building now. |
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.
overall gist of the PR looks fine, systemd-analyze security miniflux
now shows 1.2 both before and after applying this PR.
@NotAShelf can you rebase on master and drop the merge commit?
1428065
to
535600a
Compare
@ofborg build nixosTests.miniflux |
Though it works when I add these commits to my config and rebuild, tests appear to be failing:
|
535600a
to
2d61a04
Compare
Okay this should be good to go now, thank you @adamcstephens for the pointer :) |
Are there any blockers left for me to fix? If not, I think we could get this in. |
c37a351
to
ef039d0
Compare
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.
I get that this is well intended and all, but I simply do not understand the benefit here.
All of a sudden, you have no longer access to the systemd service's configuration at eval time and need to merge the unit file shipped with the package and the overrides made in .nix
by hand.
Or, alternatively, deploy it blindly and then check whatever systemctl cat
and systemctl show
make of it.
Not to mention in case cfg.package
is a custom derivation, it suddenly also needs to provide the same unit file as upstream.
In my mind, this is a huge decline of usability and increase of overhead.
And finally, I don't believe every single maintainer and drive-by merger checks the whole upstream diff of a version bump for changes in the unit file and then also understands the implications of it - meaning there is genuine risk of regressions by some unassuming upstream unit file change.
Take for example literally this PR.
It first worsened the sandboxing and then had an EnvironmentFile=
regression.
The latter is something we likely only noticed by luck, as the VM tests don't cover a lot of variety.
You might have noticed, by scrolling up, that including the upstream systemd service was something I have added on request - not by my own discretion. Initially this PR was intended solely to close a stale PR (which hardens the systemd service, and nothing else). The tone of your message is entirely unwarranted. Then came the first request to use the upstream service, which didn't hear any negative feedback. In fact, the response was "I don't particularly care how we reach hardening parity with what we have right now". Great. Frankly I'm getting a bit tired of getting pushed back and forth. "Do this", "don't to that", "wait that's a wrong word change that" (and I'm not even given the courtesy of proper spelling)... Enough is enough. Edit: The regression in the service was caused by an oversight in me resolving merge conflicts. Not a slight on anyone's behalf, but those things happen when something takes 4 months to make the least amount of progress. |
Description of changes
Continuation of #271605. Rebased around master and removedlib
from twoinstances of
lib.mkIf
asmkIf
is already in scope.Supersedes #271605.
Vendor upstream systemd service in
miniflux
package and add it tosystemd.packages
Things done
nix.conf
? (SeeNix manual)
sandbox = relaxed
sandbox = true
(look inside
nixos/tests)
package tests
lib/tests or
pkgs/test
linked
to the relevant packages
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: allchanges have to be committed, also see
nixpkgs-review usage
./result/bin/
)(or backporting
23.11
and
24.05
Release notes)
breaking
significant
module
CONTRIBUTING.md.
Add a 👍 reaction to pull requests you find important.