diff --git a/nixos/doc/manual/release-notes/rl-2611.section.md b/nixos/doc/manual/release-notes/rl-2611.section.md index bfa65265ff8f..b45905062209 100644 --- a/nixos/doc/manual/release-notes/rl-2611.section.md +++ b/nixos/doc/manual/release-notes/rl-2611.section.md @@ -16,6 +16,8 @@ - [Nezha](https://github.com/nezhahq/nezha), a self-hosted, lightweight server and website monitoring and O&M tool. Available as [services.nezha](#opt-services.nezha.enable). +- [CastSponsorSkip](https://github.com/gabe565/CastSponsorSkip/), skips YouTube sponsorships (and sometimes ads) on all local Google Cast devices. + - [FlapAlerted](https://github.com/Kioubit/FlapAlerted), detects BGP flapping events and provides statistics based on BGP update messages. Available as [services.flap-alerted](#opt-services.flap-alerted.enable). ## Backward Incompatibilities {#sec-release-26.11-incompatibilities} diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 3467f312c430..16fc9633c33b 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -838,6 +838,7 @@ ./services/misc/blenderfarm.nix ./services/misc/calibre-server.nix ./services/misc/canto-daemon.nix + ./services/misc/castsponsorskip.nix ./services/misc/cfdyndns.nix ./services/misc/cgminer.nix ./services/misc/clipcat.nix diff --git a/nixos/modules/services/misc/castsponsorskip.nix b/nixos/modules/services/misc/castsponsorskip.nix new file mode 100644 index 000000000000..0b7eb39de9c8 --- /dev/null +++ b/nixos/modules/services/misc/castsponsorskip.nix @@ -0,0 +1,49 @@ +{ + config, + pkgs, + lib, + ... +}: +let + cfg = config.services.castsponsorskip; +in +{ + options = { + services.castsponsorskip = { + enable = lib.mkEnableOption "castsponsorskip"; + package = lib.mkPackageOption pkgs "castsponsorskip" { }; + config = lib.mkOption { + type = (pkgs.formats.yaml { }).type; + default = { }; + example = { + CSS_SKIP_SPONSORS = false; + }; + description = "Configuration for the service. List of options all options ."; + }; + }; + }; + config = lib.mkIf cfg.enable { + systemd.services.castsponsorskip = + let + # Needed, even if empty, to avoid searching for a file in + # the user home directory, which doesn't exist for + # dynamic users + config = (pkgs.formats.yaml cfg.config).generate "config.yaml" { }; + in + { + description = "Skip YouTube ads and sponsorships on all local Google Cast devices"; + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + DynamicUser = true; + Restart = "always"; + ExecStart = "${lib.getExe cfg.package} --config=${config}"; + TimeoutStopSec = "20s"; + }; + }; + }; + + meta = { + maintainers = with lib.maintainers; [ wariuccio ]; + }; +}