1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-09 10:31:06 +01:00

treewide: remove with lib (#6871)

Remove from services.
This commit is contained in:
Austin Horstman 2025-04-21 09:00:59 -07:00 committed by GitHub
parent 6695b1d477
commit 82ee14ff60
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
124 changed files with 1848 additions and 1891 deletions

View file

@ -4,9 +4,6 @@
pkgs,
...
}:
with lib;
let
jsonFormat = pkgs.formats.json { };
@ -14,23 +11,23 @@ let
in
{
meta.maintainers = [ maintainers.starcraft66 ];
meta.maintainers = [ lib.maintainers.starcraft66 ];
options = {
services.plex-mpv-shim = {
enable = mkEnableOption "Plex mpv shim";
enable = lib.mkEnableOption "Plex mpv shim";
package = mkOption {
type = types.package;
package = lib.mkOption {
type = lib.types.package;
default = pkgs.plex-mpv-shim;
defaultText = literalExpression "pkgs.plex-mpv-shim";
defaultText = lib.literalExpression "pkgs.plex-mpv-shim";
description = "The package to use for the Plex mpv shim.";
};
settings = mkOption {
settings = lib.mkOption {
type = jsonFormat.type;
default = { };
example = literalExpression ''
example = lib.literalExpression ''
{
adaptive_transcode = false;
allow_http = false;
@ -51,12 +48,12 @@ in
};
};
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
assertions = [
(lib.hm.assertions.assertPlatform "services.plex-mpv-shim" pkgs lib.platforms.linux)
];
xdg.configFile."plex-mpv-shim/conf.json" = mkIf (cfg.settings != { }) {
xdg.configFile."plex-mpv-shim/conf.json" = lib.mkIf (cfg.settings != { }) {
source = jsonFormat.generate "conf.json" cfg.settings;
};