{ config, lib, ... }:
let
  cfg = config.khscodes.nix;
in
{
  options.khscodes.nix = {
    nix-community.enable = lib.mkEnableOption "Enables nix-community substituters";
  };
  config = {
    nix.settings = lib.mkIf cfg.nix-community.enable {
      substituters = [ "https://nix-community.cachix.org" ];
      trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ];
    };
  };
}
