nixos/castsponsorskip: init

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
This commit is contained in:
Mario
2026-06-19 21:20:43 +02:00
committed by Sandro Jäckel
co-authored by Sandro
parent 2f78c99890
commit f79a8a6dae
3 changed files with 52 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 ];
};
}