nix: make upcast buildable