Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 was wondering if it wouldn't be worth pulling up the
extraConfig
line (${optionalString (cfg.extraConfig != null) cfg.extraConfig}
) to before the mainsettings
section.That way, a non-sectioned setting like
WORK_PATH
could be added viaextraConfig
as well. Right now such a setting would get assigned randomly to whatever the lastsettings
section turned out to be, right?Do you see any trade-offs here, @emilylange?
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.
From go-gitea/gitea#25330
We seem to be doing something similar with
GITEA_WORK_DIR
atnixpkgs/nixos/modules/services/misc/gitea.nix
Line 625 in 687ed41
and
nixpkgs/nixos/modules/services/misc/gitea.nix
Line 665 in 687ed41
Assuming the env var does not try to update the specified
app.ini
, this might be a more suitable place.Or, alternatively, a
lib.mkDefault
edWORK_PATH = cfg.stateDir
inconfig
similar tonixpkgs/nixos/modules/services/misc/gitea.nix
Lines 391 to 392 in 687ed41
I don't know why one would want to manually override
WORK_PATH
when using the module, but ehh, maybe there are use-cases.And both solutions would allow for that :)
I don't see much value changing the order of the freeform
settings
option andextraConfig
.But maybe I just don't quite get what you mean with that^^
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 don't really know what's going on either. If there is no
WORK_PATH
inapp.ini
, it will try to add it (possibly from that env var you're mentioning). That will fail when app.ini is read-only.Maybe that could be considered a bug upstream, but I wanted to leave this here, so that we already know when doing the update.
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.
What I meant is: I couldn't add the
WORK_PATH
through extra config, because:here,
EXTRA_CONFIG = value3
would be considered part of[section1]
, even though it's meant to be unsectioned. There is also no code that could reasonably rely on this behavior, since the order of sections is essentially random and so the section that an unsectionedextraConfig
is assigned to would also be random.Also I don't think there is a way to denote a "non-section" in order to add more unsectioned values, so in my books moving the
extraConfig
up would be strictly an improvement, because it would allow adding unsectioned values at all.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.
TLDR but extraConfig is deprecated and we should remove it rather sooner than later.
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.
Good to know.
Do our
.ini
config helpers do the unsectioned preamble?