whatdoesthefedsay

What Does the Fed(eral Reserve) Say?

PowerShell Nix License

A PowerShell script that scrapes the Federal Reserve’s H.15 release page for the current effective federal funds rate and commits it as JSON to a GitHub Pages wite. Packaged as a NixOS module with a built-in systemd timer for scheduled execution.

Table of Contents

Requirements

Usage

PowerShell

Run the script directly, providing the path to your token file:

.\getrate.ps1 -TokenPath "<path-to-token-file>"

To write the rate data to a custom path within the repository:

.\getrate.ps1 -TokenPath "<path-to-token-file>" -Path "<repo-relative-file-path>"

Real examples:

# Fetch the latest Fed rate and commit it to the default 'rate.html' on main
.\getrate.ps1 -TokenPath "C:\secrets\github_token.txt"

# Same, but commit to a custom path
.\getrate.ps1 -TokenPath "C:\secrets\github_token.txt" -Path "data/rate.json"

Nix Flake

Add the flake as an input, then wire the NixOS module into your configuration:

# flake.nix
{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-<version>";
    whatdoesthefedsay = {
      url = "github:jimurrito/whatdoesthefedsay";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = { nixpkgs, whatdoesthefedsay, ... }: {
    nixosConfigurations."<hostname>" = nixpkgs.lib.nixosSystem {
      system = "<arch>";
      modules = [
        whatdoesthefedsay.nixosModules.default
        {
          services.wdtfs = {
            enable = true;
            interval = "<systemd-calendar-expression>";
            keyPath = "<path-to-token-file>";
          };
        }
      ];
    };
  };
}

Real example:

# flake.nix
{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
    whatdoesthefedsay = {
      url = "github:jimurrito/whatdoesthefedsay";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = { nixpkgs, whatdoesthefedsay, ... }: {
    nixosConfigurations."myhost" = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [
        whatdoesthefedsay.nixosModules.default
        {
          services.wdtfs = {
            enable = true;
            # triggers every hour 5:00 - 17:00, M-F
            interval = "0 5-17 * * 1-5";
            keyPath = config.age.secrets.wdtfs_key.path;
          };
        }
      ];
    };
  };
}

Nix Module Options

Option Type Default Description
services.wdtfs.enable bool false Enable the WDTFS scheduled service
services.wdtfs.keyPath string "/root/wdtfs-key" Path to a plain-text file containing the GitHub PAT
services.wdtfs.interval string "daily" How often to run. Accepts any systemd calendar expression

License

This project is licensed under the GNU General Public License v3.