Init gerbera package and reuse mediatomb service#82429
Init gerbera package and reuse mediatomb service#82429edwtjo wants to merge 2 commits intoNixOS:masterfrom
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.
if then else "" -> optionalString would be nice.
| config = mkIf cfg.enable { | ||
| systemd.services.mediatomb = { | ||
| description = "MediaTomb media Server"; | ||
| systemd.services."${name}"= { |
There was a problem hiding this comment.
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.
| dataDir = mkOption { | ||
| type = types.path; | ||
| default = "/var/lib/mediatomb"; | ||
| default = "/var/lib/" + name; |
There was a problem hiding this comment.
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.
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.
| 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.
Is this line actually required?
There was a problem hiding this comment.
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.
As expected, it works without it ;)
|
|
||
| package = mkOption { | ||
| type = types.package; | ||
| example = literalExample "pkgs.mediatomb"; |
There was a problem hiding this comment.
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
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)nix path-info -Sbefore and after)