From 2f78c99890b268c269955e91e0b6ef26644c9284 Mon Sep 17 00:00:00 2001 From: Mario <191101255+wariuccio@users.noreply.github.com> Date: Wed, 3 Jun 2026 22:21:53 +0100 Subject: [PATCH 1/2] castsponsorskip: init at 0.8.3 Co-authored-by: Sandro --- pkgs/by-name/ca/castsponsorskip/package.nix | 39 +++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 pkgs/by-name/ca/castsponsorskip/package.nix diff --git a/pkgs/by-name/ca/castsponsorskip/package.nix b/pkgs/by-name/ca/castsponsorskip/package.nix new file mode 100644 index 000000000000..0635a3dfade5 --- /dev/null +++ b/pkgs/by-name/ca/castsponsorskip/package.nix @@ -0,0 +1,39 @@ +{ + fetchFromGitHub, + buildGoModule, + lib, +}: + +buildGoModule (finalAttrs: { + pname = "castsponsorskip"; + version = "0.8.3"; + + __structuredAttrs = true; + + src = fetchFromGitHub { + owner = "gabe565"; + repo = "CastSponsorSkip"; + tag = "v${finalAttrs.version}"; + hash = "sha256-qPn753aSKlMdSEEN1QYuS3hDYtjL4Pm07mEKY1kI5Ak="; + }; + + vendorHash = "sha256-ph6rwr4FxuNpFF5DedsrMEnm28xR11bC7EcaNQJcyug="; + + checkFlags = + let + skippedTests = [ + "Test_completeCategories" # Requires network access + ]; + in + [ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ]; + + meta = { + description = "Skip YouTube sponsorships (and sometimes ads) on all local Google Cast devices"; + homepage = "https://github.com/gabe565/CastSponsorSkip"; + changelog = "https://github.com/gabe565/CastSponsorSkip/releases"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ + wariuccio + ]; + }; +}) From f79a8a6daecb3c339aaec2881a83964993c027f3 Mon Sep 17 00:00:00 2001 From: Mario <191101255+wariuccio@users.noreply.github.com> Date: Wed, 3 Jun 2026 22:54:02 +0100 Subject: [PATCH 2/2] nixos/castsponsorskip: init Co-authored-by: Sandro --- .../manual/release-notes/rl-2611.section.md | 2 + nixos/modules/module-list.nix | 1 + .../modules/services/misc/castsponsorskip.nix | 49 +++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 nixos/modules/services/misc/castsponsorskip.nix 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 ]; + }; +}