castsponsorskip: init at 0.8.3, nixos/castsponsorskip: init (#527757)

This commit is contained in:
Sandro
2026-06-19 19:25:46 +00:00
committed by GitHub
4 changed files with 91 additions and 0 deletions
@@ -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}
+1
View File
@@ -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
@@ -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 <https://github.com/gabe565/CastSponsorSkip/blob/main/docs/envs.md>.";
};
};
};
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 ];
};
}
@@ -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
];
};
})