-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
Init gerbera package and reuse mediatomb service #82429
Conversation
The duplication of the interface xml tag is needed for the daemon to respect the setting.
path = [ pkgs.mediatomb ]; | ||
serviceConfig.ExecStart = "${pkgs.mediatomb}/bin/mediatomb -p ${toString cfg.port} ${if cfg.interface!="" then "-e ${cfg.interface}" else ""} ${if cfg.customCfg then "" else "-c ${mtConf}"} -m ${cfg.dataDir}"; | ||
path = [ pkg ]; | ||
serviceConfig.ExecStart = "${pkg}/bin/${name} -p ${toString cfg.port} ${if cfg.interface!="" then "-e ${cfg.interface}" else ""} ${if cfg.customCfg then "" else "-c ${mtConf}"} -m ${cfg.dataDir}"; |
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 then else ""
-> optionalString
would be nice.
@@ -257,12 +270,12 @@ in { | |||
###### implementation | |||
|
|||
config = mkIf cfg.enable { | |||
systemd.services.mediatomb = { | |||
description = "MediaTomb media Server"; | |||
systemd.services."${name}"= { |
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.
Given the module is called mediatomb
this might cause some confusion. It might make more sense to continue to call the systemd
service mediatomb
and then add a gerbera
alias.
@@ -206,20 +219,20 @@ in { | |||
|
|||
dataDir = mkOption { | |||
type = types.path; | |||
default = "/var/lib/mediatomb"; | |||
default = "/var/lib/" + name; |
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.
This will cause existing installations to mysteriously break. Either leaving the default to mediatomb
or explicitly mentioning this in release notes is a good idea.
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.
Yes, well this was the intention since it has to be done sooner or later. I'll add it to the release notes to ease the transition.
after = [ "network.target" ]; | ||
wantedBy = [ "multi-user.target" ]; | ||
path = [ pkgs.mediatomb ]; | ||
serviceConfig.ExecStart = "${pkgs.mediatomb}/bin/mediatomb -p ${toString cfg.port} ${if cfg.interface!="" then "-e ${cfg.interface}" else ""} ${if cfg.customCfg then "" else "-c ${mtConf}"} -m ${cfg.dataDir}"; | ||
path = [ pkg ]; |
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.
Is this line actually required?
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 gather it's not since the command line specifies the full path to the binary...
We'll see ;)
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.
As expected, it works without it ;)
description = '' | ||
How to identify the server on the network. | ||
''; | ||
}; | ||
|
||
package = mkOption { | ||
type = types.package; | ||
example = literalExample "pkgs.mediatomb"; |
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.
Given the wide range of options available it might be more valuable to show an example with an override
.
Hello, Do you intend to continue and finish this? Or shall I pick it up? I started a similar work taking another approach. I did not reuse the existing mediatomb service as I don't really know what's common between gerbera and mediatomb. I generated a new conf out of the latest gerbera 1.5.0 and built from this [1] Now I realize it's not drastically different than current
I gather this could be integrated in the original mediatomb service as you did here. I also intend to extend the currently limited import js instructions. [1] https://gitlab.com/ardumont/nixos/-/blob/master/odroid/gerbera/service.nix Cheers, |
Heads up, this can be closed now as #93450 which supersedes it has been merged. Again, I reused some of the work here, thanks! Cheers, |
Motivation for this change
Mediatomb replacement package which is actively maintained. For now just uses the old mediatomb service since the packages are, from a process level viewpoint, interchangeable.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)