-
-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
miniflux: add service #52638
miniflux: add service #52638
Conversation
5c3c8d7
to
c29854b
Compare
type = types.package; | ||
default = pkgs.miniflux; | ||
defaultText = "pkgs.miniflux"; | ||
description = "Which miniflux package to use."; |
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.
If there are no alternative packages or any other good reason to have such an option, I prefer not to have it, see #50476
user = mkOption { | ||
type = types.str; | ||
default = "miniflux"; | ||
example = "miniflux"; |
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.
No need to add an example when it's the default anyways (the default will displayed be in the docs too), same for some of the other options.
name = cfg.user; | ||
group = cfg.group; | ||
description = "miniflux service user"; | ||
isSystemUser = true; |
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.
Why is this needed?
}; | ||
|
||
config = mkIf cfg.enable { | ||
services.postgresql.enable = mkDefault true; |
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.
Why mkDefault
? This service requires it to be true
and it won't work if this gets overridden to be false by something else.
|
||
serviceConfig = { | ||
PermissionsStartOnly = true; | ||
Type = "simple"; |
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.
"simple"
is the default
configFile = pkgs.writeText "miniflux.conf" '' | ||
LISTEN_ADDR=${cfg.listenAddress}:${toString cfg.listenPort} | ||
DATABASE_URL="postgresql://${dbUser}:${dbPassword}@${dbHost}/${dbName}?sslmode=disable" | ||
RUN_MIGRATIONS=1 |
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.
Just set these variables with
{
systemd.services.miniflux = {
environment = {
LISTEN_ADDR = ...;
# ...
};
# ...
};
}
PrivateTmp = false; | ||
ExecStart = "${cfg.package}/bin/miniflux"; | ||
EnvironmentFile = configFile; | ||
User = cfg.user; |
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.
Forgot to set the group
Superseded by #56719 |
Motivation for this change
miniflux package already exists, this adds a service
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)I'm new at this! Please let me know if I've done something silly :)