That’d look something like this:
# configuration.nix
{ lib, pkgs, ... }: {
services.gitea.package = lib.mkIf (lib.versionOlder pkgs.gitea "28.1.0") (
pkgs.gitea.overrideAttrs (
drv: old: {
# You'll have to manually update this number for security
# fixes until you upgrade to 26.11
version = "28.1.0";
src = old.src.override {
tag = "v${drv.version}";
# REMEMBER to update this if you bump versions; otherwise nix won't
# actually update the source but still give you an "updated" gitea
# version number.
hash = pkgs.lib.fakeHash;
};
}
)
);
}
This might or might not work, depending on how many changes there were to gitea’s build scripts and dependencies. If it doesn’t work OOTB you can probably fix it, but that’ll require understanding how to build packages with nix a bit.
I’m not a huge fan of recommending that approach because I don’t believe the kind of person who asks for help with this has the contextual knowledge to update properly, including bumping the source hash. But big ol’ comments hopefully go a long way, and @rseichter sounds like enough of a sysadmin to be able to follow those instructions 
It’s probably the cleanest solution when it works and is done correctly. Still runs the risk of not being able to update quickly when a critical CVE is patched but the build script needs updating when you have zero context for how the upstream package works, but I’ll leave that risk assessment to you.
The alternative is something like:
# flake.nix
{
inputs = {
nixpkgs.url = "https://channels.nixos.org/nixos-26.05/nixexprs.tar.xz";
nixpkgs-unstable.url = "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz";
};
outputs = { nixpkgs, ... }@inputs: {
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
configuration = [ ./configuration.nix ];
};
};
}
And then one of these:
# configuration.nix
{ inputs, pkgs, ... }: {
services.gitea.package = pkgs.callPackage "${inputs.nixpkgs-unstable}/pkgs/by-name/gi/gitea/package.nix" { };
}
or
# configuration.nix
{ inputs, pkgs, ... }: {
services.gitea.package = inputs.nixpkgs-unstable.legacyPackages.${pkgs.stdenv.hostPlatform.system}.gitea;
}
The benefit of the former is that you’ll be linking against libraries - and using other dependencies - from nixpkgs stable. This means that you’ll have way more integration and duplicate less stuff. The downside is that the build was never actually tested with those versions so it might not work. Unlike the .overrideAttrs solution the build script will be correct though.
The latter will always work, but has the least good integration with your system, I usually treat it as a last resort.