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/mpd: Allow to configure a credentialsFile #95599
Conversation
Allow to specify a password file to be located outside the store, and be read in `ExecStartPre`.
@@ -181,7 +193,12 @@ in { | |||
|
|||
serviceConfig = { | |||
User = "${cfg.user}"; | |||
ExecStart = "${pkgs.mpd}/bin/mpd --no-daemon ${mpdConf}"; | |||
ExecStart = "${pkgs.mpd}/bin/mpd --no-daemon /etc/mpd.conf"; | |||
ExecStartPre = pkgs.writeScript "mpd-start-pre" '' |
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.
Maybe we should only do this when credentialsFile
is actually used?
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 would be the benefit? The only notable difference I see is the permissions of this file, previously it was r--r--r--
and now it's rw-r-----
.
nixos/modules/services/audio/mpd.nix
Outdated
@@ -11,6 +11,8 @@ let | |||
cfg = config.services.mpd; | |||
|
|||
mpdConf = pkgs.writeText "mpd.conf" '' | |||
# This file was automatically generated by nixos. Edit mpd's configuration via NixOS' configuration.nix |
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 a small nitpick: You should use a consistent spelling of NixOS
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 agree :).
813a95f
to
b4756fe
Compare
Thanks @Sohalt for the review. For the record, I was considering whether release notes should be updated, and I think the answer is no - there is no breaking change, facing users - it's only |
Motivation for this change
Allow to specify a password file to be located outside the store, and be read in
ExecStartPre
. Modeled after a recent transmission patch implementing a similar idea.ccing some members of the community which I'm pretty sure use this module: @marsam @astsmtl @ehmry @fpletz @tobim .
Things done
Update release notes?
Tested using sandboxing (nix.useSandbox on NixOS, or option
sandbox
innix.conf
on non-NixOS linux)Built on platform(s)
Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
Tested compilation of all pkgs that depend on this change using
nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
Tested execution of all binary files (usually in
./result/bin/
)Determined the impact on package closure size (by running
nix path-info -S
before and after)Ensured that relevant documentation is up to date
Fits CONTRIBUTING.md.